use of org.gradle.deployment.internal.DeploymentRegistry 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;
}
use of org.gradle.deployment.internal.DeploymentRegistry in project gradle by gradle.
the class PlayRun method registerOrFindDeploymentHandle.
private PlayApplicationDeploymentHandle registerOrFindDeploymentHandle(String deploymentId) {
DeploymentRegistry deploymentRegistry = getDeploymentRegistry();
PlayApplicationDeploymentHandle deploymentHandle = deploymentRegistry.get(PlayApplicationDeploymentHandle.class, deploymentId);
if (deploymentHandle == null) {
deploymentHandle = new PlayApplicationDeploymentHandle(deploymentId);
deploymentRegistry.register(deploymentId, deploymentHandle);
}
return deploymentHandle;
}
Aggregations