Skip to content

Commit 1e09968

Browse files
committed
Refactor Doma Compile Plugin usage and adjust JPMS handling
1 parent ed887ef commit 1e09968

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

build.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.kotlin.dsl.invoke
2+
13
plugins {
24
java
35
alias(libs.plugins.eclipse.apt)
@@ -47,10 +49,7 @@ subprojects {
4749
apply(plugin = "java")
4850
apply(plugin = catalog.plugins.eclipse.apt.get().pluginId)
4951
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-
}
52+
apply(plugin = catalog.plugins.doma.compile.get().pluginId)
5453

5554
java {
5655
toolchain {
@@ -61,10 +60,6 @@ subprojects {
6160
tasks {
6261
withType<JavaCompile> {
6362
options.encoding = "UTF-8"
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-
}
6863
}
6964

7065
withType<Test> {

example-jpms/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ application {
1010
dependencies {
1111
implementation(project(":common"))
1212
}
13+
14+
tasks {
15+
compileJava {
16+
// TODO: This is a workaround. JPMS-compatible modules can’t be built with the Doma Compile Plugin.
17+
options.sourcepath = files(sourceSets["main"].java.srcDirs + sourceSets["main"].resources.srcDirs)
18+
}
19+
}

0 commit comments

Comments
 (0)