Search in sources :

Example 1 with SnapshotCollectingDiffListener

use of org.gradle.internal.watch.registry.impl.SnapshotCollectingDiffListener in project gradle by gradle.

the class WatchingVirtualFileSystem method updateNotifyingListeners.

@Override
protected SnapshotHierarchy updateNotifyingListeners(UpdateFunction updateFunction) {
    if (watchRegistry == null) {
        return updateFunction.update(SnapshotHierarchy.NodeDiffListener.NOOP);
    } else {
        SnapshotCollectingDiffListener diffListener = new SnapshotCollectingDiffListener();
        SnapshotHierarchy newRoot = updateFunction.update(diffListener);
        return withWatcherChangeErrorHandling(newRoot, () -> diffListener.publishSnapshotDiff((removedSnapshots, addedSnapshots) -> watchRegistry.virtualFileSystemContentsChanged(removedSnapshots, addedSnapshots, newRoot)));
    }
}
Also used : BuildStartedFileSystemWatchingBuildOperationType(org.gradle.internal.watch.vfs.BuildStartedFileSystemWatchingBuildOperationType) FileSystemWatchingStatistics(org.gradle.internal.watch.vfs.FileSystemWatchingStatistics) FileWatcherRegistry(org.gradle.internal.watch.registry.FileWatcherRegistry) WatchingNotSupportedException(org.gradle.internal.watch.WatchingNotSupportedException) BuildOperationRunner(org.gradle.internal.operations.BuildOperationRunner) LoggerFactory(org.slf4j.LoggerFactory) DaemonDocumentationIndex(org.gradle.internal.watch.registry.impl.DaemonDocumentationIndex) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) WatchLogging(org.gradle.internal.watch.vfs.WatchLogging) ImmutableList(com.google.common.collect.ImmutableList) BuildFinishedFileSystemWatchingBuildOperationType(org.gradle.internal.watch.vfs.BuildFinishedFileSystemWatchingBuildOperationType) Path(java.nio.file.Path) Nullable(javax.annotation.Nullable) LinkedHashSet(java.util.LinkedHashSet) WatchableFileSystemDetector(org.gradle.internal.watch.vfs.WatchableFileSystemDetector) FileSystemNode(org.gradle.internal.snapshot.FileSystemNode) Logger(org.slf4j.Logger) VfsRootReference(org.gradle.internal.vfs.impl.VfsRootReference) WatchMode(org.gradle.internal.watch.registry.WatchMode) SnapshotCollectingDiffListener(org.gradle.internal.watch.registry.impl.SnapshotCollectingDiffListener) Set(java.util.Set) CallableBuildOperation(org.gradle.internal.operations.CallableBuildOperation) IOException(java.io.IOException) BuildOperationDescriptor(org.gradle.internal.operations.BuildOperationDescriptor) SnapshotHierarchy(org.gradle.internal.snapshot.SnapshotHierarchy) BuildLifecycleAwareVirtualFileSystem(org.gradle.internal.watch.vfs.BuildLifecycleAwareVirtualFileSystem) FileSystemWatchingInformation(org.gradle.internal.watch.vfs.FileSystemWatchingInformation) File(java.io.File) InotifyWatchesLimitTooLowException(net.rubygrapefruit.platform.internal.jni.InotifyWatchesLimitTooLowException) CheckReturnValue(javax.annotation.CheckReturnValue) List(java.util.List) FileChangeListeners(org.gradle.internal.watch.vfs.FileChangeListeners) VfsLogging(org.gradle.internal.watch.vfs.VfsLogging) NativeException(net.rubygrapefruit.platform.NativeException) FileWatcherRegistryFactory(org.gradle.internal.watch.registry.FileWatcherRegistryFactory) Closeable(java.io.Closeable) BuildOperationContext(org.gradle.internal.operations.BuildOperationContext) AbstractVirtualFileSystem(org.gradle.internal.vfs.impl.AbstractVirtualFileSystem) InotifyInstanceLimitTooLowException(net.rubygrapefruit.platform.internal.jni.InotifyInstanceLimitTooLowException) SnapshotCollectingDiffListener(org.gradle.internal.watch.registry.impl.SnapshotCollectingDiffListener) SnapshotHierarchy(org.gradle.internal.snapshot.SnapshotHierarchy)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 Closeable (java.io.Closeable)1 File (java.io.File)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 Set (java.util.Set)1 Supplier (java.util.function.Supplier)1 CheckReturnValue (javax.annotation.CheckReturnValue)1 Nullable (javax.annotation.Nullable)1 NativeException (net.rubygrapefruit.platform.NativeException)1 InotifyInstanceLimitTooLowException (net.rubygrapefruit.platform.internal.jni.InotifyInstanceLimitTooLowException)1 InotifyWatchesLimitTooLowException (net.rubygrapefruit.platform.internal.jni.InotifyWatchesLimitTooLowException)1 BuildOperationContext (org.gradle.internal.operations.BuildOperationContext)1 BuildOperationDescriptor (org.gradle.internal.operations.BuildOperationDescriptor)1 BuildOperationRunner (org.gradle.internal.operations.BuildOperationRunner)1 CallableBuildOperation (org.gradle.internal.operations.CallableBuildOperation)1 FileSystemNode (org.gradle.internal.snapshot.FileSystemNode)1