Fix compilation of Java 9 sources for kotlin-reflect-api
Do not pass the jars for modules such as descriptors, descriptors.jvm, etc to `--module-path` because javac assumes that these are separate modules (even though they're listed later as parts of this module in `--patch-module), and prohibits to have split packages and foreign service implementations among them
This commit is contained in:
@@ -65,12 +65,14 @@ ext.compileJava9Sources = { Project project, String moduleName, Collection<FileC
|
||||
it.options.sourcepath = files(java9SourceSet.srcDirs)
|
||||
|
||||
doFirst {
|
||||
def moduleFiles = moduleOutputs.collect { it.files }.flatten().join(File.pathSeparator)
|
||||
def moduleFiles = files(*moduleOutputs)
|
||||
def modulePath = project.configurations.compileClasspath.filter { !(it in moduleFiles.files) }
|
||||
|
||||
options.compilerArgs = [
|
||||
'--module-path', project.configurations.compileClasspath.asPath,
|
||||
'--patch-module', "$moduleName=$moduleFiles"
|
||||
'--module-path', modulePath.asPath,
|
||||
'--patch-module', "$moduleName=${moduleFiles.asPath}"
|
||||
]
|
||||
|
||||
classpath = files()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user