Skip to content

Commit ed887ef

Browse files
committed
Disable Doma Compile Plugin for JPMS-compatible modules
1 parent 75dcf97 commit ed887ef

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
java
33
alias(libs.plugins.eclipse.apt)
44
alias(libs.plugins.spotless)
5-
alias(libs.plugins.doma.compile)
5+
alias(libs.plugins.doma.compile) apply false
66
}
77

88
// Retain a reference to rootProject.libs to make the version catalog accessible within allprojects and subprojects.
@@ -47,6 +47,10 @@ subprojects {
4747
apply(plugin = "java")
4848
apply(plugin = catalog.plugins.eclipse.apt.get().pluginId)
4949
apply(plugin = catalog.plugins.spotless.get().pluginId)
50+
// TODO: This is a workaround. JPMS-compatible modules can’t be built with the Doma Compile Plugin.
51+
if (project.name != "example-jpms") {
52+
apply(plugin = catalog.plugins.doma.compile.get().pluginId)
53+
}
5054

5155
java {
5256
toolchain {
@@ -57,8 +61,10 @@ subprojects {
5761
tasks {
5862
withType<JavaCompile> {
5963
options.encoding = "UTF-8"
60-
// TODO Remove this workaround
61-
options.compilerArgs.add("-Adoma.resources.dir=" + sourceSets["main"].resources.srcDirs.first().absolutePath)
64+
// TODO: This is a workaround. JPMS-compatible modules can’t be built with the Doma Compile Plugin.
65+
if (project.name == "example-jpms") {
66+
options.compilerArgs.add("-Adoma.resources.dir=" + sourceSets["main"].resources.srcDirs.first().absolutePath)
67+
}
6268
}
6369

6470
withType<Test> {

0 commit comments

Comments
 (0)