29d2679e8d
This change avoids compiling kotlin-compiler-embeddable, kotlin-gradle-plugin, and other gradle plugins, when running `./gradlew dist`
88 lines
1.8 KiB
Groovy
88 lines
1.8 KiB
Groovy
description = 'Kotlin Standard Library JDK 8 extension'
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
configureJvm6Project(project)
|
|
configureDist(project)
|
|
configurePublishing(project)
|
|
ext.javaHome = JDK_18
|
|
ext.jvmTarget = "1.8"
|
|
|
|
dependencies {
|
|
compile project(':kotlin-stdlib')
|
|
compile project(':kotlin-stdlib-jdk7')
|
|
testCompile project(':kotlin-test:kotlin-test-junit')
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
kotlin {
|
|
srcDir 'src'
|
|
}
|
|
}
|
|
test {
|
|
kotlin {
|
|
srcDir 'test'
|
|
if(!System.properties.'idea.active') {
|
|
srcDir '../test'
|
|
srcDir '../jdk7/test'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
jar {
|
|
manifestAttributes(manifest, project, 'Main')
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
|
|
dist {
|
|
from (jar, sourcesJar)
|
|
}
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
|
kotlinOptions.jdkHome = JDK_18
|
|
kotlinOptions.jvmTarget = 1.8
|
|
}
|
|
|
|
compileKotlin {
|
|
kotlinOptions.freeCompilerArgs = [
|
|
"-Xallow-kotlin-package",
|
|
"-Xmultifile-parts-inherit",
|
|
"-Xnormalize-constructor-calls=enable",
|
|
"-Xdump-declarations-to=${buildDir}/stdlib-jdk8-declarations.json",
|
|
"-module-name", project.name
|
|
]
|
|
}
|
|
|
|
compileTestKotlin {
|
|
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
|
|
}
|
|
|
|
kotlin.experimental.coroutines 'enable'
|
|
|
|
test {
|
|
executable = "$JDK_18/bin/java"
|
|
}
|
|
|
|
task testJdk6Tests(type: Test) {
|
|
dependsOn(':kotlin-stdlib:testClasses')
|
|
group = "verification"
|
|
|
|
executable = "$JDK_18/bin/java"
|
|
|
|
doFirst {
|
|
testClassesDirs = project(':kotlin-stdlib').sourceSets.test.output
|
|
classpath = files(
|
|
testClassesDirs,
|
|
configurations.testCompile
|
|
)
|
|
}
|
|
}
|
|
|
|
check.dependsOn testJdk6Tests
|