Search in sources :

Example 1 with RepositoryResourceAccessor

use of org.gradle.api.artifacts.repositories.RepositoryResourceAccessor 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 RepositoryResourceAccessor

use of org.gradle.api.artifacts.repositories.RepositoryResourceAccessor in project gradle by gradle.

the class AbstractArtifactRepository method createInjectorForMetadataSuppliers.

/**
 * 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
 */
ImplicitInputsCapturingInstantiator createInjectorForMetadataSuppliers(final RepositoryTransport transport, InstantiatorFactory instantiatorFactory, final URI rootUri, final FileStore<String> externalResourcesFileStore) {
    DefaultServiceRegistry registry = new DefaultServiceRegistry();
    registry.addProvider(new Object() {

        RepositoryResourceAccessor createResourceAccessor() {
            return createRepositoryAccessor(transport, rootUri, externalResourcesFileStore);
        }
    });
    registry.add(ObjectFactory.class, objectFactory);
    return new ImplicitInputsCapturingInstantiator(registry, instantiatorFactory);
}
Also used : DefaultServiceRegistry(org.gradle.internal.service.DefaultServiceRegistry) ImplicitInputsCapturingInstantiator(org.gradle.internal.resolve.caching.ImplicitInputsCapturingInstantiator) RepositoryResourceAccessor(org.gradle.api.artifacts.repositories.RepositoryResourceAccessor) ExternalRepositoryResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.ExternalRepositoryResourceAccessor)

Example 3 with RepositoryResourceAccessor

use of org.gradle.api.artifacts.repositories.RepositoryResourceAccessor in project gradle by gradle.

the class DefaultIvyArtifactRepository method createInjectorForMetadataSupplier.

/**
 * 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 createInjectorForMetadataSupplier(final RepositoryTransport transport) {
    DefaultServiceRegistry registry = new DefaultServiceRegistry();
    registry.addProvider(new Object() {

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

Aggregations

RepositoryResourceAccessor (org.gradle.api.artifacts.repositories.RepositoryResourceAccessor)3 ExternalRepositoryResourceAccessor (org.gradle.api.internal.artifacts.repositories.resolver.ExternalRepositoryResourceAccessor)3 DefaultServiceRegistry (org.gradle.internal.service.DefaultServiceRegistry)3 DependencyInjectingInstantiator (org.gradle.api.internal.DependencyInjectingInstantiator)1 ImplicitInputsCapturingInstantiator (org.gradle.internal.resolve.caching.ImplicitInputsCapturingInstantiator)1