Package org.gradle.api.internal.initialization

Examples of org.gradle.api.internal.initialization.ClassLoaderScope


    }

    private void applyScript(Object script) {
        URI scriptUri = resolver.resolveUri(script);
        UriScriptSource scriptSource = new UriScriptSource("script", scriptUri);
        ClassLoaderScope classLoaderScopeChild = classLoaderScope.createChild();
        ScriptHandler scriptHandler = scriptHandlerFactory.create(scriptSource, classLoaderScopeChild);
        ScriptPlugin configurer = configurerFactory.create(scriptSource, scriptHandler, classLoaderScopeChild, classLoaderScope, "buildscript", DefaultScript.class, false);
        for (Object target : targets) {
            configurer.apply(target);
        }
View Full Code Here


    public FileResolver getFileResolver() {
        return fileOperations.getFileResolver();
    }

    private DefaultObjectConfigurationAction createObjectConfigurationAction() {
        ClassLoaderScope classLoaderScope = __scriptServices.get(ClassLoaderScope.class);
        return new DefaultObjectConfigurationAction(
                getFileResolver(),
                __scriptServices.get(ScriptPluginFactory.class),
                __scriptServices.get(ScriptHandlerFactory.class),
                classLoaderScope,
View Full Code Here

        // We found the desired settings file, now build the associated buildSrc before loading settings.  This allows
        // the settings script to reference classes in the buildSrc.
        StartParameter buildSrcStartParameter = startParameter.newBuild();
        buildSrcStartParameter.setCurrentDir(new File(settingsLocation.getSettingsDir(), BaseSettings.DEFAULT_BUILD_SRC_DIR));
        ClassLoaderScope buildSourceClassLoader = buildSourceBuilder.buildAndCreateClassLoader(buildSrcStartParameter);

        return settingsProcessor.process(gradle, settingsLocation, buildSourceClassLoader, startParameter);
    }
View Full Code Here

        this.cacheRepository = cacheRepository;
    }

    public ClassLoaderScope buildAndCreateClassLoader(StartParameter startParameter) {
        ClassPath classpath = createBuildSourceClasspath(startParameter);
        ClassLoaderScope childScope = classLoaderScope.createChild();
        childScope.export(classpath);
        childScope.lock();
        return childScope;
    }
View Full Code Here

        ServiceRegistry topLevelRegistry = new TestBuildScopeServices(GLOBAL_SERVICES, startParameter, homeDir);
        GradleInternal gradle = new DefaultGradle(null, startParameter, topLevelRegistry.get(ServiceRegistryFactory.class));

        DefaultProjectDescriptor projectDescriptor = new DefaultProjectDescriptor(null, name, projectDir, new DefaultProjectDescriptorRegistry(),
                topLevelRegistry.get(FileResolver.class));
        ClassLoaderScope baseScope = gradle.getClassLoaderScope();
        ClassLoaderScope rootProjectScope = baseScope.createChild();
        ProjectInternal project = topLevelRegistry.get(IProjectFactory.class).createProject(projectDescriptor, null, gradle, rootProjectScope, baseScope);

        gradle.setRootProject(project);
        gradle.setDefaultProject(project);
View Full Code Here

        return settings;
    }

    private void applySettingsScript(SettingsLocation settingsLocation, final SettingsInternal settings) {
        ScriptSource settingsScriptSource = settingsLocation.getSettingsScriptSource();
        ClassLoaderScope settingsClassLoaderScope = settings.getClassLoaderScope();
        ScriptHandler scriptHandler = scriptHandlerFactory.create(settingsScriptSource, settingsClassLoaderScope);
        ScriptPlugin configurer = configurerFactory.create(settingsScriptSource, scriptHandler, settingsClassLoaderScope, settings.getRootClassLoaderScope(), "buildscript", SettingsScript.class, false);
        configurer.apply(settings);
    }
View Full Code Here

        final GradleInternal gradle = context.mock(GradleInternal.class);
        final SettingsLocation settingsLocation = new SettingsLocation(settingsDir, new File("foo"));

        PropertiesLoadingSettingsProcessor processor = new PropertiesLoadingSettingsProcessor(delegate, propertiesLoader);

        final ClassLoaderScope classLoaderScope = new RootClassLoaderScope(urlClassLoader, new DummyClassLoaderCache());

        context.checking(new Expectations() {{
            one(propertiesLoader).loadProperties(settingsDir);
            one(delegate).process(gradle, settingsLocation, classLoaderScope, startParameter);
            will(returnValue(settings));
View Full Code Here

        this.configurerFactory = configurerFactory;
        this.scriptHandlerFactory = scriptHandlerFactory;
    }

    public void process(final ScriptSource initScript, GradleInternal gradle) {
        ClassLoaderScope baseScope = gradle.getClassLoaderScope();
        ClassLoaderScope scriptScope = baseScope.createChild();
        ScriptHandler scriptHandler = scriptHandlerFactory.create(initScript, scriptScope);
        ScriptPlugin configurer = configurerFactory.create(initScript, scriptHandler, scriptScope, baseScope, "initscript", InitScript.class, false);
        configurer.apply(gradle);
    }
View Full Code Here

        return pluginId;
    }

    public Class<?> resolve() {
        ClassPath classPath = classPathFactory.create();
        ClassLoaderScope loaderScope = parent.createChild();
        loaderScope.local(classPath);
        loaderScope.lock();
        PluginRegistry pluginRegistry = new DefaultPluginRegistry(pluginInspector, loaderScope.getLocalClassLoader());
        PotentialPluginWithId lookup = pluginRegistry.lookup(pluginId.toString());
        if (lookup == null) {
            throw new UnknownPluginException("Plugin with id '" + pluginId + "' not found.");

        }
View Full Code Here

TOP

Related Classes of org.gradle.api.internal.initialization.ClassLoaderScope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.