private ServiceRegistry createGlobalClientServices() {
   return ServiceRegistryBuilder.builder()
       .displayName("Daemon client global services")
       .parent(NativeServices.getInstance())
       .provider(new GlobalScopeServices(false))
       .provider(new DaemonClientGlobalServices())
       .build();
 }
Beispiel #2
0
 /** This is used by consumers 1.0-milestone-3 and later */
 public DefaultConnection() {
   LOGGER.debug("Tooling API provider {} created.", GradleVersion.current().getVersion());
   LoggingServiceRegistry loggingServices = LoggingServiceRegistry.newEmbeddableLogging();
   services =
       ServiceRegistryBuilder.builder()
           .displayName("Connection services")
           .parent(loggingServices)
           .parent(NativeServices.getInstance())
           .provider(new ConnectionScopeServices(loggingServices))
           .build();
   adapter = services.get(ProtocolToModelAdapter.class);
   connection = services.get(ProviderConnection.class);
 }
  private Runnable runBuildInProcess(
      StartParameter startParameter,
      DaemonParameters daemonParameters,
      ServiceRegistry loggingServices) {
    ServiceRegistry globalServices =
        ServiceRegistryBuilder.builder()
            .displayName("Global services")
            .parent(loggingServices)
            .parent(NativeServices.getInstance())
            .provider(new GlobalScopeServices(startParameter.isContinuous()))
            .build();

    BuildActionExecuter<BuildActionParameters> executer = globalServices.get(BuildExecuter.class);
    StyledTextOutputFactory textOutputFactory = globalServices.get(StyledTextOutputFactory.class);
    DocumentationRegistry documentationRegistry = globalServices.get(DocumentationRegistry.class);
    DaemonUsageSuggestingBuildActionExecuter daemonUsageSuggestingExecuter =
        new DaemonUsageSuggestingBuildActionExecuter(
            executer, textOutputFactory, documentationRegistry);

    return runBuild(
        startParameter, daemonParameters, daemonUsageSuggestingExecuter, globalServices);
  }