Search in sources :

Example 1 with InstantiatorFactory

use of org.gradle.internal.instantiation.InstantiatorFactory in project gradle by gradle.

the class DefaultProject method newDetachedResolver.

@Override
public DetachedResolver newDetachedResolver() {
    DependencyManagementServices dms = getServices().get(DependencyManagementServices.class);
    InstantiatorFactory instantiatorFactory = services.get(InstantiatorFactory.class);
    DefaultServiceRegistry lookup = new DefaultServiceRegistry(services);
    lookup.addProvider(new Object() {

        public DependencyResolutionServices createServices() {
            return dms.create(services.get(FileResolver.class), services.get(FileCollectionFactory.class), services.get(DependencyMetaDataProvider.class), new UnknownProjectFinder("Detached resolvers do not support resolving projects"), new DetachedDependencyResolutionDomainObjectContext(services.get(DomainObjectContext.class)));
        }
    });
    return instantiatorFactory.decorate(lookup).newInstance(LocalDetachedResolver.class);
}
Also used : InstantiatorFactory(org.gradle.internal.instantiation.InstantiatorFactory) DefaultServiceRegistry(org.gradle.internal.service.DefaultServiceRegistry) DependencyResolutionServices(org.gradle.api.internal.artifacts.DependencyResolutionServices) DependencyManagementServices(org.gradle.api.internal.artifacts.DependencyManagementServices) BeanDynamicObject(org.gradle.internal.metaobject.BeanDynamicObject) DynamicObject(org.gradle.internal.metaobject.DynamicObject) ExtensibleDynamicObject(org.gradle.internal.extensibility.ExtensibleDynamicObject) UnknownProjectFinder(org.gradle.api.internal.artifacts.dsl.dependencies.UnknownProjectFinder) DomainObjectContext(org.gradle.api.internal.DomainObjectContext)

Aggregations

DomainObjectContext (org.gradle.api.internal.DomainObjectContext)1 DependencyManagementServices (org.gradle.api.internal.artifacts.DependencyManagementServices)1 DependencyResolutionServices (org.gradle.api.internal.artifacts.DependencyResolutionServices)1 UnknownProjectFinder (org.gradle.api.internal.artifacts.dsl.dependencies.UnknownProjectFinder)1 ExtensibleDynamicObject (org.gradle.internal.extensibility.ExtensibleDynamicObject)1 InstantiatorFactory (org.gradle.internal.instantiation.InstantiatorFactory)1 BeanDynamicObject (org.gradle.internal.metaobject.BeanDynamicObject)1 DynamicObject (org.gradle.internal.metaobject.DynamicObject)1 DefaultServiceRegistry (org.gradle.internal.service.DefaultServiceRegistry)1