inTestDirectory().withTasks("do-stuff").run().assertTasksExecuted(":child1:do-stuff", ":child2:do-stuff");
}
@Test
public void multiProjectBuildCanHaveSettingsFileAndRootBuildFileInSubDir() {
TestFile buildFilesDir = getTestDir().file("root");
TestFile settingsFile = buildFilesDir.file("settings.gradle");
settingsFile.writelns(
"includeFlat 'child'",
"rootProject.projectDir = new File(settingsDir, '..')",
"rootProject.buildFileName = 'root/build.gradle'"
);
TestFile rootBuildFile = buildFilesDir.file("build.gradle");
rootBuildFile.write("task('do-stuff', dependsOn: ':child:task')");
TestFile childBuildFile = testFile("child/build.gradle");
childBuildFile.writelns("task('do-stuff')", "task('task')");
usingProjectDir(getTestDir()).usingSettingsFile(settingsFile).withTasks("do-stuff").run().assertTasksExecuted(":child:task", ":do-stuff", ":child:do-stuff");
usingBuildFile(rootBuildFile).withTasks("do-stuff").run().assertTasksExecuted(":child:task", ":do-stuff", ":child:do-stuff");
usingBuildFile(childBuildFile).usingSettingsFile(settingsFile).withTasks("do-stuff").run().assertTasksExecuted(":child:do-stuff");
}