use of org.gradle.api.internal.changedetection.state.GlobalScopeFileTimeStampInspector in project gradle by gradle.
the class DefaultGradleLauncherFactory method newInstance.
@Override
public GradleLauncher newInstance(StartParameter startParameter, BuildRequestContext requestContext, ServiceRegistry parentRegistry) {
// This should only be used for top-level builds
if (rootBuild != null) {
throw new IllegalStateException("Cannot have a current build");
}
if (!(parentRegistry instanceof BuildSessionScopeServices)) {
throw new IllegalArgumentException("Service registry must be of build session scope");
}
BuildSessionScopeServices sessionScopeServices = (BuildSessionScopeServices) parentRegistry;
DefaultGradleLauncher launcher = doNewInstance(startParameter, null, requestContext.getCancellationToken(), requestContext, requestContext.getEventConsumer(), sessionScopeServices, ImmutableList.of(new Stoppable() {
@Override
public void stop() {
rootBuild = null;
}
}));
rootBuild = launcher;
DeploymentRegistry deploymentRegistry = parentRegistry.get(DeploymentRegistry.class);
deploymentRegistry.onNewBuild(launcher.getGradle());
GlobalScopeFileTimeStampInspector timeStampInspector = sessionScopeServices.get(GlobalScopeFileTimeStampInspector.class);
launcher.addListener(timeStampInspector);
return launcher;
}
Aggregations