use of org.gradle.launcher.daemon.protocol.InvalidateVirtualFileSystem in project gradle by gradle.
the class HandleInvalidateVirtualFileSystem method execute.
@Override
public void execute(DaemonCommandExecution execution) {
if (execution.getCommand() instanceof InvalidateVirtualFileSystem) {
InvalidateVirtualFileSystem command = (InvalidateVirtualFileSystem) execution.getCommand();
gradleUserHomeScopeServiceRegistry.getCurrentServices().ifPresent(currentServices -> {
LOGGER.info("Invalidating {}", command.getChangedPaths());
FileSystemAccess fileSystemAccess = currentServices.get(FileSystemAccess.class);
fileSystemAccess.write(command.getChangedPaths(), () -> {
});
});
execution.getConnection().completed(new Success(null));
} else {
execution.proceed();
}
}
use of org.gradle.launcher.daemon.protocol.InvalidateVirtualFileSystem in project gradle by gradle.
the class NotifyDaemonAboutChangedPathsClient method notifyDaemonsAboutChangedPaths.
public void notifyDaemonsAboutChangedPaths(List<String> changedPaths) {
for (DaemonInfo daemonInfo : daemonRegistry.getAll()) {
DaemonStateControl.State state = daemonInfo.getState();
if (state == Idle || state == Busy || state == Canceled) {
DaemonClientConnection connection = connector.maybeConnect(daemonInfo);
if (connection == null) {
continue;
}
dispatch(connection, new InvalidateVirtualFileSystem(changedPaths, idGenerator.generateId(), connection.getDaemon().getToken()));
}
}
}
Aggregations