Package org.gradle

Examples of org.gradle.StartParameter


        parser.option(PROFILE).hasDescription("Profiles build execution time and generates a report in the <build_dir>/reports/profile directory.");
    }

    @Override
    protected StartParameter newInstance() {
        return new StartParameter();
    }
View Full Code Here


    @Test
    public void loadsPropertiesThenDelegatesToBackingSettingsProcessor() {
        final SettingsProcessor delegate = context.mock(SettingsProcessor.class);
        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);
View Full Code Here

        assertEquals(expectedInitScripts, startParameter.getInitScripts());
        assertEquals(expectedProfile, startParameter.isProfile());
    }

    private void checkConversion(final boolean embedded, String... args) {
        actualStartParameter = new StartParameter();
        actualStartParameter.setCurrentDir(currentDir);
        commandLineConverter.convert(Arrays.asList(args), actualStartParameter);
        // We check the params passed to the build factory
        checkStartParameter(actualStartParameter);
        if (embedded) {
View Full Code Here

            }
        }

        final File homeDir = new File(projectDir, "gradleHome");

        StartParameter startParameter = new StartParameter();
        startParameter.setGradleUserHomeDir(new File(projectDir, "userHome"));

        ServiceRegistryFactory topLevelRegistry = new TestTopLevelBuildServiceRegistry(startParameter, homeDir);
        GradleInternal gradle = new DefaultGradle(null, startParameter, topLevelRegistry);

        DefaultProjectDescriptor projectDescriptor = new DefaultProjectDescriptor(null, "test", projectDir, new DefaultProjectDescriptorRegistry());
View Full Code Here

    @Test
    public void testFindScripts() {
        JUnit4Mockery context = new JUnit4Mockery();

        final GradleInternal gradleMock = context.mock(GradleInternal.class);
        final StartParameter testStartParameter = new StartParameter();
        testStartParameter.addInitScript(new File("some init script"));
        testStartParameter.addInitScript(new File("/path/to/another init script"));

        context.checking(new Expectations() {{
            allowing(gradleMock).getStartParameter();
            will(returnValue(testStartParameter));
        }});

        List<ScriptSource> sourceList = new DefaultInitScriptFinder().findScripts(gradleMock);
        assertThat(getSourceFiles(sourceList), equalTo(canonicalise(testStartParameter.getInitScripts())));
    }
View Full Code Here

    private final ScriptSource settingsScriptSource = context.mock(ScriptSource.class);
    private final EmbeddedScriptSettingsFinder settingsFinder = new EmbeddedScriptSettingsFinder(delegate);

    @Test
    public void usesProvidedScriptAsSettingsFileWhenSettingsFileSpecifiedInStartParam() {
        StartParameter parameter = new StartParameter();
        parameter.setSettingsScriptSource(settingsScriptSource);

        SettingsLocation settingsLocation = settingsFinder.find(parameter);

        assertThat(settingsLocation.getSettingsScriptSource(), sameInstance(settingsScriptSource));
    }
View Full Code Here

        assertThat(settingsLocation.getSettingsScriptSource(), sameInstance(settingsScriptSource));
    }

    @Test
    public void usesCurrentDirAsSettingsDirWhenSettingsFileSpecifiedInStartParam() throws IOException {
        StartParameter parameter = new StartParameter();
        File currentDir = new File("current dir");

        parameter.setSettingsScriptSource(settingsScriptSource);
        parameter.setCurrentDir(currentDir);

        SettingsLocation settingsLocation = settingsFinder.find(parameter);

        assertThat(settingsLocation.getSettingsDir(), equalTo(currentDir.getCanonicalFile()));
    }
View Full Code Here

        assertThat(settingsLocation.getSettingsDir(), equalTo(currentDir.getCanonicalFile()));
    }

    @Test
    public void delegatesWhenSettingsFileNotSpecifiedInStartParam() {
        final StartParameter parameter = new StartParameter();
        final File settingsDir = new File("settings dir");

        context.checking(new Expectations() {{
            one(delegate).find(parameter);
            will(returnValue(new SettingsLocation(settingsDir, settingsScriptSource)));
View Full Code Here

        file.deleteOnExit();
        return file;
    }

    protected StartParameter createStartParams(boolean searchUpwards) {
        StartParameter startParameter = new StartParameter();
        startParameter.setCurrentDir(currentDir);
        startParameter.setSearchUpwards(searchUpwards);
        return startParameter;
    }
View Full Code Here

    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]);
        GradleInternal gradle = context.mock(GradleInternal.class);

        DefaultSettings settings = (DefaultSettings) settingsFactory.createSettings(gradle,
View Full Code Here

TOP

Related Classes of org.gradle.StartParameter

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.