Package org.gradle.groovy.scripts

Examples of org.gradle.groovy.scripts.ScriptSource


        final URLClassLoader urlClassLoader = new URLClassLoader(new URL[0]);
        final IGradlePropertiesLoader propertiesLoader = context.mock(IGradlePropertiesLoader.class);
        final StartParameter startParameter = new StartParameter();
        final SettingsInternal settings = context.mock(SettingsInternal.class);
        final File settingsDir = new File("root");
        final ScriptSource settingsScriptSource = context.mock(ScriptSource.class);
        final GradleInternal gradle = context.mock(GradleInternal.class);
        final SettingsLocation settingsLocation = new SettingsLocation(settingsDir, settingsScriptSource);

        PropertiesLoadingSettingsProcessor processor = new PropertiesLoadingSettingsProcessor(delegate);
View Full Code Here


    @Test
    public void testProcess() {
        final ScriptPluginFactory scriptPluginFactory = context.mock(ScriptPluginFactory.class);
        final ScriptPlugin configurer = context.mock(ScriptPlugin.class);
        final ScriptSource initScriptMock = context.mock(ScriptSource.class);
        final GradleInternal gradleMock = context.mock(GradleInternal.class);

        context.checking(new Expectations() {{
            one(scriptPluginFactory).create(initScriptMock);
            will(returnValue(configurer));
View Full Code Here

    }};

    @Test
    public void createSettings() {
        final File expectedSettingsDir = new File("settingsDir");
        ScriptSource expectedScriptSource = context.mock(ScriptSource.class);
        Map<String, String> expectedGradleProperties = WrapUtil.toMap("key", "myvalue");
        IProjectDescriptorRegistry expectedProjectDescriptorRegistry = new DefaultProjectDescriptorRegistry();
        StartParameter expectedStartParameter = new StartParameter();
        SettingsFactory settingsFactory = new SettingsFactory(expectedProjectDescriptorRegistry);
        final URLClassLoader urlClassLoader = new URLClassLoader(new URL[0]);
View Full Code Here

        this.classGenerator = classGenerator;
    }

    public DefaultProject createProject(ProjectDescriptor projectDescriptor, ProjectInternal parent, GradleInternal gradle) {
        File buildFile = projectDescriptor.getBuildFile();
        ScriptSource source;
        if (embeddedScript != null) {
            source = embeddedScript;
        } else if (!buildFile.exists()) {
            source = new StringScriptSource("empty build file", "");
        } else {
View Full Code Here

        JUnit4Mockery context = new JUnit4Mockery();

        final InitScriptFinder finderMock = context.mock(InitScriptFinder.class);
        final InitScriptProcessor processorMock = context.mock(InitScriptProcessor.class);
        final GradleInternal gradleMock = context.mock(GradleInternal.class);
        final ScriptSource source1Mock = context.mock(ScriptSource.class, "source 1");
        final ScriptSource source2Mock = context.mock(ScriptSource.class, "source 2");
        final List<ScriptSource> testSources = new ArrayList<ScriptSource>();
        testSources.add(source1Mock);
        testSources.add(source2Mock);

        context.checking(new Expectations() {{
View Full Code Here

                startParameter.getCurrentDir()).invalidateOnVersionChange().open().openStateCache();
        boolean rebuild = stateCache.get() == null;

        if (!new File(startParameter.getCurrentDir(), Project.DEFAULT_BUILD_FILE).isFile()) {
            LOGGER.debug("Gradle script file does not exist. Using default one.");
            ScriptSource source = new StringScriptSource("default buildSrc build script", getDefaultScript());
            startParameterArg.setBuildScriptSource(source);
        }

        GradleLauncher gradleLauncher = gradleLauncherFactory.newInstance(startParameterArg);
        BuildSrcBuildListener listener = new BuildSrcBuildListener(rebuild);
View Full Code Here

    public DefaultExceptionAnalyser(ListenerManager listenerManager) {
        listenerManager.addListener(this);
    }

    public void beforeScript(Script script) {
        ScriptSource source = script.getScriptSource();
        scripts.put(source.getFileName(), source);
    }
View Full Code Here

        }
        if (actualException instanceof LocationAwareException) {
            return actualException;
        }

        ScriptSource source = null;
        Integer lineNumber = null;

        // todo - remove this special case
        if (actualException instanceof ScriptCompilationException) {
            ScriptCompilationException scriptCompilationException = (ScriptCompilationException) actualException;
View Full Code Here

        assertThat(project.getBuildScriptSource().getResource().getText(), equalTo(""));
    }

    @Test
    public void testConstructsRootProjectWithEmbeddedBuildScript() {
        ScriptSource expectedScriptSource = new StringScriptSource("script", "content");

        ProjectFactory projectFactory = new ProjectFactory(expectedScriptSource, classGeneratorMock);

        DefaultProject project = projectFactory.createProject(descriptor("somename"), null, gradle);
View Full Code Here

        this.projectRegistry = projectRegistry;
    }

    public DefaultProject createProject(ProjectDescriptor projectDescriptor, ProjectInternal parent, GradleInternal gradle, ClassLoaderScope selfClassLoaderScope, ClassLoaderScope baseClassLoaderScope) {
        File buildFile = projectDescriptor.getBuildFile();
        ScriptSource source;
        if (!buildFile.exists()) {
            source = new StringScriptSource("empty build file", "");
        } else {
            source = new UriScriptSource("build file", buildFile);
        }
View Full Code Here

TOP

Related Classes of org.gradle.groovy.scripts.ScriptSource

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.