Skip to content

Commit ed5d6fc

Browse files
committed
Create gradle.properties in ProcessingPluginTest
Add creation of sketch/gradle.properties in ProcessingPluginTest, writing processing.group derived from System.getProperty("project.group").replace(".java", ""). This ensures the test project has the expected processing.group property within the tests
1 parent 4206874 commit ed5d6fc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

java/gradle/src/test/kotlin/ProcessingPluginTest.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ class ProcessingPluginTest{
2424
}
2525
""".trimIndent())
2626
directory.newFile("sketch/settings.gradle.kts")
27+
directory.newFile("sketch/gradle.properties").writeText(
28+
"""
29+
processing.group=${System.getProperty("project.group").replace(".java", "")}
30+
""".trimIndent()
31+
)
2732
configure(sketchFolder)
2833

2934
val buildResult = GradleRunner.create()
@@ -218,6 +223,7 @@ class ProcessingPluginTest{
218223
""".trimIndent())
219224
sketchFolder.resolve("gradle.properties").writeText(""")
220225
processing.workingDir = ${sketchFolder.parentFile.absolutePath}
226+
processing.group=${System.getProperty("project.group").replace(".java", "")}
221227
""".trimIndent())
222228
}
223229
val sketchClass = classLoader.loadClass("sketch")
@@ -250,9 +256,12 @@ class ProcessingPluginTest{
250256
println("Hello World");
251257
}
252258
""".trimIndent())
253-
sketchFolder.resolve("gradle.properties").writeText(""")
259+
sketchFolder.resolve("gradle.properties").writeText(
260+
"""
254261
processing.sketchbook = ${libraryResult.libraryFolder.parentFile.parentFile.absolutePath}
255-
""".trimIndent())
262+
processing.group=${System.getProperty("project.group").replace(".java", "")}
263+
""".trimIndent()
264+
)
256265
}
257266

258267
val sketchClass = classLoader.loadClass("sketch")

0 commit comments

Comments
 (0)