Skip to content

Commit b02e2a4

Browse files
committed
Move module-info.java to a java9-specific dir due to IDEA highlighting issues
1 parent 9ea8aef commit b02e2a4

File tree

16 files changed

+4
-2
lines changed

16 files changed

+4
-2
lines changed

buildSrc/src/main/kotlin/Java9Modularity.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ object Java9Modularity {
3333

3434
val compileJavaModuleInfo = tasks.register("compileJavaModuleInfo", JavaCompile::class.java) {
3535
val moduleName = project.name.replace('-', '.') // this module's name
36-
val sourceFile = compilation.defaultSourceSet.kotlin.singleOrNull { it.name == "module-info.java" }
37-
?: throw IllegalStateException("module-info.java not found in $project")
36+
val sourceFile = file("${target.name.ifEmpty { "." }}/java9/module-info.java")
37+
if (!sourceFile.exists()) {
38+
throw IllegalStateException("$sourceFile not found in $project")
39+
}
3840
val compileKotlinTask = compilation.compileKotlinTask as org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3941
val targetDir = compileKotlinTask.destinationDirectory.dir("../java9")
4042

0 commit comments

Comments
 (0)