75ad20f823
Required as a workaround for Proguard bug https://sourceforge.net/p/proguard/bugs/664/ When processing bytecode generated by Kotlin compiler for constructor call with stack spilling during arguments evaluation, ProGuard performs an equivalent transformation for the bytecode, but emits invalid stack frame information. In JVM 1.6, such invalid stack frames are ignored and re-evaluated by JVM during bytecode verification. In JVM 1.8, such invalid stack frames cause VerifyError.
144 lines
3.3 KiB
Groovy
144 lines
3.3 KiB
Groovy
description = 'Kotlin Standard Library'
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
configureJvm6Project(project)
|
|
configurePublishing(project)
|
|
|
|
sourceSets {
|
|
annotations {
|
|
if(!System.properties.'idea.active') {
|
|
java {
|
|
srcDir "${rootDir}/core/runtime.jvm/src"
|
|
include 'org/jetbrains/annotations/**'
|
|
}
|
|
kotlin {
|
|
exclude '**/*'
|
|
}
|
|
}
|
|
}
|
|
builtins {
|
|
java {
|
|
srcDir "${rootDir}/core/builtins/src"
|
|
srcDir "${rootDir}/core/runtime.jvm/src"
|
|
exclude 'org/jetbrains/annotations/**'
|
|
}
|
|
kotlin {
|
|
srcDir "${rootDir}/core/builtins/src"
|
|
srcDir "${rootDir}/core/runtime.jvm/src"
|
|
exclude 'org/jetbrains/annotations/**'
|
|
}
|
|
}
|
|
main {
|
|
java {
|
|
srcDir 'src'
|
|
}
|
|
}
|
|
test {
|
|
kotlin {
|
|
srcDir 'test'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
builtinsCompile group: 'org.jetbrains', name: 'annotations', version:'13.0'
|
|
compile group: 'org.jetbrains', name: 'annotations', version:'13.0'
|
|
compile sourceSets.builtins.output
|
|
|
|
testCompile project(':kotlin-test:kotlin-test-junit')
|
|
}
|
|
|
|
configurations {
|
|
mainJar
|
|
builtins
|
|
}
|
|
|
|
task originalStdlibJar(type: Jar) {
|
|
baseName = 'original-kotlin-stdlib'
|
|
from sourceSets.main.output
|
|
}
|
|
|
|
jar {
|
|
manifestAttributes(manifest, project, 'Main')
|
|
from("${rootDir}/dist/builtins")
|
|
from sourceSets.builtins.output
|
|
}
|
|
|
|
task distJar(type: Jar) {
|
|
baseName = 'dist-kotlin-stdlib'
|
|
version = null
|
|
manifestAttributes(manifest, project, 'Main')
|
|
from("${rootDir}/dist/builtins")
|
|
from sourceSets.annotations.output
|
|
from sourceSets.builtins.output
|
|
from sourceSets.main.output
|
|
}
|
|
|
|
task builtinsJar(type: Jar) {
|
|
baseName = "builtins"
|
|
from("${rootDir}/dist/builtins")
|
|
from sourceSets.builtins.output
|
|
}
|
|
|
|
sourcesJar {
|
|
from "${rootDir}/core/builtins/native"
|
|
from sourceSets.builtins.kotlin
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
mainJar jar
|
|
builtins builtinsJar
|
|
}
|
|
|
|
dist {
|
|
[distJar, sourcesJar].forEach {
|
|
from(it) {
|
|
rename('dist-', '')
|
|
}
|
|
// legacy
|
|
from(it) {
|
|
rename('dist-', '')
|
|
rename('kotlin-stdlib', 'kotlin-runtime')
|
|
}
|
|
}
|
|
from (configurations.compile) {
|
|
include 'annotations*.jar'
|
|
}
|
|
}
|
|
|
|
task dexMethodCount(type: DexMethodCount) {
|
|
from jar
|
|
ownPackages = ['kotlin']
|
|
}
|
|
check.dependsOn(dexMethodCount)
|
|
|
|
compileBuiltinsKotlin {
|
|
dependsOn ":core:builtins:serialize"
|
|
kotlinOptions {
|
|
freeCompilerArgs = [
|
|
"-version",
|
|
"-Xallow-kotlin-package",
|
|
"-Xdump-declarations-to", "${buildDir}/runtime-declarations.json",
|
|
"-cp", "${rootDir}/dist/builtins",
|
|
"-module-name", "kotlin-runtime"
|
|
]
|
|
}
|
|
}
|
|
compileKotlin {
|
|
kotlinOptions {
|
|
freeCompilerArgs = [
|
|
"-version",
|
|
"-Xallow-kotlin-package",
|
|
"-Xmultifile-parts-inherit",
|
|
"-Xnormalize-constructor-calls=enable",
|
|
"-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json",
|
|
"-module-name", project.name
|
|
]
|
|
}
|
|
}
|
|
|
|
kotlin.experimental.coroutines 'enable'
|