Examples of writelns()


Examples of org.gradle.util.TestFile.writelns()

    }

    @Test
    public void executesAllTasksInASingleBuildAndEachTaskAtMostOnce() {
        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns(
                "gradle.taskGraph.whenReady { assert !project.hasProperty('graphReady'); graphReady = true }",
                "task a << { task -> project.executedA = task }",
                "task b << { ",
                "    assert a == project.executedA",
                "    assert gradle.taskGraph.hasTask(':a')",
View Full Code Here

Examples of org.gradle.util.TestFile.writelns()

    @Test
    public void executesMultiProjectsTasksInASingleBuildAndEachTaskAtMostOnce() {
        testFile("settings.gradle").writelns("include 'child1', 'child2'");
        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns(
                "task a",
                "allprojects {",
                "    task b",
                "    task c(dependsOn: ['b', ':a'])",
                "}");
View Full Code Here

Examples of org.gradle.util.TestFile.writelns()

    @Test
    public void executesMultiProjectDefaultTasksInASingleBuildAndEachTaskAtMostOnce() {
        testFile("settings.gradle").writelns("include 'child1', 'child2'");
        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns("defaultTasks 'a', 'b'", "task a", "subprojects {", "    task a(dependsOn: ':a')",
                "    task b(dependsOn: ':a')", "}");
        usingBuildFile(buildFile).run().assertTasksExecuted(":a", ":child1:a", ":child2:a", ":child1:b", ":child2:b");
    }

    @Test
View Full Code Here

Examples of org.gradle.util.TestFile.writelns()

    }

    @Test
    public void executesProjectDefaultTasksWhenNoneSpecified() {
        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns(
                "task a",
                "task b(dependsOn: a)",
                "defaultTasks 'b'"
        );
        usingBuildFile(buildFile).withTasks().run().assertTasksExecuted(":a", ":b");
View Full Code Here

Examples of org.gradle.util.TestFile.writelns()

    }
   
    @Test
    public void doesNotExecuteTaskActionsWhenDryRunSpecified() {
        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns(
                "task a << { fail() }",
                "task b(dependsOn: a) << { fail() }",
                "defaultTasks 'b'"
        );
View Full Code Here

Examples of org.gradle.util.TestFile.writelns()

    @Test
    public void excludesTasksWhenExcludePatternSpecified() {
        testFile("settings.gradle").write("include 'sub'");
        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns(
                "task a",
                "task b(dependsOn: a)",
                "task c(dependsOn: [a, b])",
                "task d(dependsOn: c)",
                "defaultTasks 'd'"
View Full Code Here

Examples of org.gradle.util.TestFile.writelns()

public class SettingsScriptErrorIntegrationTest extends AbstractIntegrationTest {
    @Test
    public void reportsSettingsScriptEvaluationFailsWithRuntimeException() throws IOException {
        TestFile buildFile = testFile("some build.gradle");
        TestFile settingsFile = testFile("some settings.gradle");
        settingsFile.writelns("", "", "throw new RuntimeException('<failure message>')");

        ExecutionFailure failure = usingBuildFile(buildFile).usingSettingsFile(settingsFile).withTasks("do-stuff")
                .runWithFailure();

        failure.assertHasFileName(String.format("Settings file '%s'", settingsFile));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.