Files
kotlin-fork/libraries/reflect/api/build.gradle
T
Alexander Udalov 0925e1b497 Enable JVM IR for stdlib/reflect/test libraries
Changes in Gradle integration tests are needed because:
- in new-mpp-android, kotlin-stdlib-jdk8 is used, and JVM IR generates
  JDK 8-specific bytecode (invokedynamic). D8 needs to be configured to
  desugar it with source/target versions set to 1.8, otherwise it
  reports an error.
- in AndroidExtensionsManyVariants and AndroidIcepickProject, D8 fails
  with assertions enabled if AGP < 4.0.0 is used because of
  https://issuetracker.google.com/issues/148661132. The tests which use
  old AGP versions are probably not relevant anymore anyway.

Changes in kotlin-stdlib-runtime-merged.txt are caused by a slightly
different generation scheme of collection subclasses in JVM IR, and are
harmless.

(Previous attempt was at 15e978dbd311c2ba78ec32b394c21acde9811ccb.)
2021-08-05 12:36:35 +02:00

72 lines
1.6 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 {
compile 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) {
LibrariesCommon.configureJava9Compilation(
project,
'kotlin.reflect',
[sourceSets.main.output, configurations.compileOnly.filter {
!it.name.contains("kotlin-stdlib")
}]
)
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xno-optimized-callable-references",
"-Xno-kotlin-nothing-value-exception",
"-Xsuppress-deprecated-jvm-target-warning",
"-Xopt-in=kotlin.RequiresOptIn",
]
moduleName = "kotlin-reflection"
}
}
jar {
manifestAttributes(manifest, project, "internal")
}
task java9Jar(type: Jar) {
classifier = "java9"
if (includeJava9) {
from sourceSets.java9.output
}
}
artifacts {
archives java9Jar
runtime java9Jar
}