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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,12 @@ dependencies {
|
||||
compileOnly project(':core:util.runtime')
|
||||
}
|
||||
|
||||
compileJava9Sources(project, 'kotlin.reflect', [sourceSets.main.output, configurations.compileOnly])
|
||||
compileJava9Sources(
|
||||
project, 'kotlin.reflect',
|
||||
[sourceSets.main.output, configurations.compileOnly.filter {
|
||||
!it.name.contains("kotlin-stdlib")
|
||||
}]
|
||||
)
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
|
||||
Reference in New Issue
Block a user