Skip to content

Commit a7030b6

Browse files
committed
Configure module reads for Java tasks and javadoc
1 parent d9c546f commit a7030b6

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,30 @@ subprojects {
2929
}
3030
}
3131

32+
tasks.withType<JavaCompile>().configureEach {
33+
project.findProperty("moduleName")?.let { moduleName ->
34+
options.compilerArgs.addAll(listOf("--add-reads", "$moduleName=ALL-UNNAMED"))
35+
}
36+
}
37+
38+
tasks.withType<Test>().configureEach {
39+
project.findProperty("moduleName")?.let { moduleName ->
40+
jvmArgs("--add-reads", "$moduleName=ALL-UNNAMED")
41+
}
42+
}
43+
44+
tasks.withType<JavaExec>().configureEach {
45+
project.findProperty("moduleName")?.let { moduleName ->
46+
jvmArgs("--add-reads", "$moduleName=ALL-UNNAMED")
47+
}
48+
}
49+
3250
tasks.named<Javadoc>("javadoc") {
3351
val options = options as StandardJavadocDocletOptions
3452
options.tags("apiNote:a:API Note:", "implSpec:a:Implementation Requirements:")
53+
project.findProperty("moduleName")?.let { moduleName ->
54+
options.addStringOption("-add-reads", "$moduleName=ALL-UNNAMED")
55+
}
3556
}
3657

3758
afterEvaluate {

bungeecord/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
val moduleName by extra("dev.faststats.bungeecord")
2+
13
repositories {
24
maven("https://repo.papermc.io/repository/maven-public/")
35
}

bungeecord/src/main/java/module-info.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
module dev.faststats.bungeecord {
55
exports dev.faststats.bungeecord;
66

7-
requires bungeecord.api;
87
requires com.google.gson;
98
requires dev.faststats.core;
109
requires java.logging;

0 commit comments

Comments
 (0)