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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations