Files
kotlin-fork/libraries/reflect/api/build.gradle
T
Zac Sweers 482874fdc1 Embed proguard/R8 rules in kotlin-reflect artifact jar
The Android build pipeline can extract embedded proguard configurations
from dependencies and merge them automatically. This adds a conservative
proguard configuration to the kotlin-reflect JVM artifact in support of
that. This focuses mostly on just retaining what's necessary for
kotlin-reflect's own functionality to operate, but could be expanded if
community feedback discovers other good candidate rules.

With this in place - most Android projects using R8 or Proguard should
Just Work™️ with kotlin-reflect.
2020-01-17 20:03:52 +01:00

67 lines
1.5 KiB
Groovy

description = ''
apply plugin: 'kotlin'
configureJvm6Project(project)
def includeJava9 = BuildPropertiesKt.getKotlinBuildProperties(project).includeJava9
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) {
compileJava9Sources(
project, 'kotlin.reflect',
[sourceSets.main.output, configurations.compileOnly.filter {
!it.name.contains("kotlin-stdlib")
}]
)
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-version",
"-Xallow-kotlin-package",
"-Xnormalize-constructor-calls=enable",
"-module-name", "kotlin-reflection"]
}
}
jar {
manifestAttributes(manifest, project, "internal")
}
task java9Jar(type: Jar) {
classifier = "java9"
if (includeJava9) {
from sourceSets.java9.output
}
}
artifacts {
archives java9Jar
runtime java9Jar
}