Skip to content

Commit 8b0cdaf

Browse files
committed
Set project.group system property for tests
Expose the project's group to test JVMs by configuring tasks.withType<Test>() to set systemProperty("project.group", group ?: "org.processing"). Update ProcessingPluginTest to read the plugin id from System.getProperty("project.group") instead of hardcoding the group. Also close the publishing block in build.gradle.kts. This allows tests to adapt when the project group is overridden.
1 parent cc780cf commit 8b0cdaf

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

java/gradle/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ publishing{
4343
url = uri(project(":app").layout.buildDirectory.dir("resources-bundled/common/repository").get().asFile.absolutePath)
4444
}
4545
}
46+
}
47+
48+
tasks.withType<Test>().configureEach {
49+
systemProperty("project.group", group ?: "org.processing")
4650
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ProcessingPluginTest{
2020
val sketchFolder = directory.newFolder("sketch")
2121
directory.newFile("sketch/build.gradle.kts").writeText("""
2222
plugins {
23-
id("org.processing.java")
23+
id("${System.getProperty("project.group")}.java")
2424
}
2525
""".trimIndent())
2626
directory.newFile("sketch/settings.gradle.kts")

0 commit comments

Comments
 (0)