Skip to content

Commit bc57868

Browse files
committed
Use gradle arguments for isolated projects tests
1 parent 4e9839f commit bc57868

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/MultiProjectTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public void predeclaredUndeclared() throws IOException {
154154

155155
@Test
156156
void nonPredeclaredSupportsIsolatedProjects() throws IOException {
157-
setFile("gradle.properties").toContent("org.gradle.unsafe.isolated-projects=true");
158157
setFile("build.gradle").toLines(
159158
"plugins {",
160159
" id 'com.diffplug.spotless'",
@@ -168,12 +167,11 @@ void nonPredeclaredSupportsIsolatedProjects() throws IOException {
168167
" }",
169168
"}");
170169
createNSubprojects();
171-
gradleRunner().withArguments("spotlessApply").build();
170+
gradleRunner().withArguments("spotlessApply", "-Dorg.gradle.unsafe.isolated-projects=true").build();
172171
}
173172

174173
@Test
175174
void predeclaredRequiresNonIsolatedProjects() throws IOException {
176-
setFile("gradle.properties").toContent("org.gradle.unsafe.isolated-projects=true");
177175
setFile("build.gradle").toLines(
178176
"plugins {",
179177
" id 'com.diffplug.spotless'",
@@ -184,7 +182,7 @@ void predeclaredRequiresNonIsolatedProjects() throws IOException {
184182
" java { googleJavaFormat('1.17.0') }",
185183
"}");
186184
createNSubprojects();
187-
Assertions.assertThat(gradleRunner().withArguments("spotlessApply").buildAndFail().getOutput())
185+
Assertions.assertThat(gradleRunner().withArguments("spotlessApply", "-Dorg.gradle.unsafe.isolated-projects=true").buildAndFail().getOutput())
188186
.containsAnyOf("Cannot access project", "cannot access 'Project.tasks'");
189187
}
190188
}

0 commit comments

Comments
 (0)