2f230833ac
`compileOnly` configuration is unresolvable, and it's more preferable to create new configuration that extends from it rather than making it resolvable
78 lines
1.8 KiB
Groovy
78 lines
1.8 KiB
Groovy
description = ''
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_6)
|
|
|
|
def includeJava9 = BuildPropertiesExtKt.getIncludeJava9(project.kotlinBuildProperties)
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
srcDir "${rootDir}/core/reflection.jvm/src"
|
|
}
|
|
resources {
|
|
srcDir("${rootDir}/core/reflection.jvm/resources")
|
|
}
|
|
}
|
|
|
|
if (includeJava9) {
|
|
java9
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
api kotlinStdlib()
|
|
compileOnly project(':core:descriptors')
|
|
compileOnly project(':core:descriptors.jvm')
|
|
compileOnly project(':core:deserialization')
|
|
compileOnly project(':core:descriptors.runtime')
|
|
compileOnly project(':core:util.runtime')
|
|
compileOnly "org.jetbrains:annotations:13.0"
|
|
}
|
|
|
|
if (includeJava9) {
|
|
configurations.register('java9PatchModule') {
|
|
extendsFrom(configurations.compileOnly)
|
|
exclude(group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib')
|
|
canBeResolved = true
|
|
}
|
|
|
|
LibrariesCommon.configureJava9Compilation(
|
|
project,
|
|
'kotlin.reflect',
|
|
[sourceSets.main.output, configurations.java9PatchModule]
|
|
)
|
|
}
|
|
|
|
compileKotlin {
|
|
kotlinOptions {
|
|
freeCompilerArgs = [
|
|
"-Xallow-kotlin-package",
|
|
"-Xno-optimized-callable-references",
|
|
"-Xno-kotlin-nothing-value-exception",
|
|
"-Xsuppress-deprecated-jvm-target-warning",
|
|
"-opt-in=kotlin.RequiresOptIn",
|
|
]
|
|
moduleName = "kotlin-reflection"
|
|
}
|
|
}
|
|
|
|
configureFrontendIr(project)
|
|
|
|
jar {
|
|
manifestAttributes(manifest, project, "internal")
|
|
}
|
|
|
|
task java9Jar(type: Jar) {
|
|
classifier = "java9"
|
|
if (includeJava9) {
|
|
from sourceSets.java9.output
|
|
}
|
|
}
|
|
|
|
artifacts {
|
|
archives java9Jar
|
|
runtimeElements java9Jar
|
|
}
|