Search in sources :

Example 1 with DefaultServiceRegistry

use of org.gradle.internal.service.DefaultServiceRegistry in project gradle by gradle.

the class DefaultIvyArtifactRepository method createDependencyInjectingInstantiator.

/**
     * Creates a service registry giving access to the services we want to expose to rules and returns an instantiator that
     * uses this service registry.
     * @param transport the transport used to create the repository accessor
     * @return a dependency injecting instantiator, aware of services we want to expose
     */
private Instantiator createDependencyInjectingInstantiator(final RepositoryTransport transport) {
    DefaultServiceRegistry registry = new DefaultServiceRegistry();
    registry.addProvider(new Object() {

        RepositoryResourceAccessor createResourceAccessor() {
            return createRepositoryAccessor(transport);
        }
    });
    return new DependencyInjectingInstantiator(registry, constructorCache);
}
Also used : DefaultServiceRegistry(org.gradle.internal.service.DefaultServiceRegistry) RepositoryResourceAccessor(org.gradle.api.artifacts.repositories.RepositoryResourceAccessor) ExternalRepositoryResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.ExternalRepositoryResourceAccessor) DependencyInjectingInstantiator(org.gradle.api.internal.DependencyInjectingInstantiator)

Example 2 with DefaultServiceRegistry

use of org.gradle.internal.service.DefaultServiceRegistry in project gradle by gradle.

the class DefaultDependencyManagementServices method create.

public DependencyResolutionServices create(FileResolver fileResolver, DependencyMetaDataProvider dependencyMetaDataProvider, ProjectFinder projectFinder, DomainObjectContext domainObjectContext) {
    DefaultServiceRegistry services = new DefaultServiceRegistry(parent);
    services.add(FileResolver.class, fileResolver);
    services.add(DependencyMetaDataProvider.class, dependencyMetaDataProvider);
    services.add(ProjectFinder.class, projectFinder);
    services.add(DomainObjectContext.class, domainObjectContext);
    services.addProvider(new DependencyResolutionScopeServices());
    return services.get(DependencyResolutionServices.class);
}
Also used : DefaultServiceRegistry(org.gradle.internal.service.DefaultServiceRegistry)

Example 3 with DefaultServiceRegistry

use of org.gradle.internal.service.DefaultServiceRegistry in project gradle by gradle.

the class NoIsolationWorkerFactory method setWorkerExecutor.

// Attaches the owning WorkerExecutor to this factory
public void setWorkerExecutor(WorkerExecutor workerExecutor) {
    DefaultServiceRegistry services = new DefaultServiceRegistry();
    services.add(WorkerExecutor.class, workerExecutor);
    actionInstantiator = instantiatorFactory.inject(services);
}
Also used : DefaultServiceRegistry(org.gradle.internal.service.DefaultServiceRegistry)

Example 4 with DefaultServiceRegistry

use of org.gradle.internal.service.DefaultServiceRegistry in project gradle by gradle.

the class DaemonClientFactory method createSingleUseDaemonClientServices.

/**
 * Creates the services for a {@link DaemonClient} that can be used to run a build in a single-use daemon.
 */
public ServiceRegistry createSingleUseDaemonClientServices(OutputEventListener loggingReceiver, DaemonParameters daemonParameters, InputStream stdin) {
    DefaultServiceRegistry loggingServices = new DefaultServiceRegistry(sharedServices);
    loggingServices.add(OutputEventListener.class, loggingReceiver);
    return new SingleUseDaemonClientServices(loggingServices, daemonParameters, stdin);
}
Also used : DefaultServiceRegistry(org.gradle.internal.service.DefaultServiceRegistry)

Example 5 with DefaultServiceRegistry

use of org.gradle.internal.service.DefaultServiceRegistry in project gradle by gradle.

the class DaemonClientFactory method createBuildClientServices.

/**
 * Creates the services for a {@link DaemonClient} that can be used to run builds.
 */
public ServiceRegistry createBuildClientServices(OutputEventListener loggingReceiver, DaemonParameters daemonParameters, InputStream stdin) {
    DefaultServiceRegistry loggingServices = new DefaultServiceRegistry(sharedServices);
    loggingServices.add(OutputEventListener.class, loggingReceiver);
    return new DaemonClientServices(loggingServices, daemonParameters, stdin);
}
Also used : DefaultServiceRegistry(org.gradle.internal.service.DefaultServiceRegistry)

Aggregations

DefaultServiceRegistry (org.gradle.internal.service.DefaultServiceRegistry)8 RepositoryResourceAccessor (org.gradle.api.artifacts.repositories.RepositoryResourceAccessor)2 ExternalRepositoryResourceAccessor (org.gradle.api.internal.artifacts.repositories.resolver.ExternalRepositoryResourceAccessor)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 DependencyInjectingInstantiator (org.gradle.api.internal.DependencyInjectingInstantiator)1 UncheckedException (org.gradle.internal.UncheckedException)1