Provide module-source-path compiler argument through CommandLineArgumentProvider
diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts
index 1f85e6b..dc49f90 100644
--- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts
@@ -154,7 +154,6 @@
"-Xlint:all,-requires-automatic,-requires-transitive-automatic",
"-Werror", // Terminates compilation when warnings occur.
"--module-version", "${project.version}",
- "--module-source-path", files(modularProjects.map { "${it.projectDir}/src/module" }).asPath
))
options.compilerArgumentProviders.add(ModulePathArgumentProvider())
options.compilerArgumentProviders.addAll(modularProjects.map { PatchModuleArgumentProvider(it) })
@@ -218,7 +217,12 @@
inner class ModulePathArgumentProvider : CommandLineArgumentProvider, Named {
@get:CompileClasspath
val modulePath: Provider<Configuration> = configurations.compileClasspath
- override fun asArguments() = listOf("--module-path", modulePath.get().asPath)
+ override fun asArguments() = listOf(
+ "--module-path",
+ modulePath.get().asPath,
+ "--module-source-path",
+ files(modularProjects.map { "${it.projectDir}/src/module" }).asPath
+ )
@Internal
override fun getName() = "module-path"
}