08d831934a
This reverts commit 1dfcec3a93.
133 lines
2.9 KiB
Groovy
133 lines
2.9 KiB
Groovy
description = 'Kotlin Standard Library JDK 7 extension'
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
configureJvm6Project(project)
|
|
configurePublishing(project)
|
|
configureSourcesJar()
|
|
configureJavadocJar()
|
|
|
|
ext.javaHome = JDK_17
|
|
|
|
sourceSets {
|
|
main {
|
|
kotlin {
|
|
srcDir 'src'
|
|
}
|
|
}
|
|
test {
|
|
kotlin {
|
|
srcDir 'test'
|
|
if(!BuildPropertiesKt.getKotlinBuildProperties(project).inIdeaSync) {
|
|
srcDir '../jvm/test'
|
|
srcDir '../common/test'
|
|
srcDir '../test'
|
|
}
|
|
}
|
|
}
|
|
noJdk7Test {
|
|
kotlin {
|
|
srcDir 'testNoJdk7'
|
|
}
|
|
}
|
|
java9 {
|
|
java {
|
|
srcDir 'java9'
|
|
}
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
noJdk7TestCompile.extendsFrom(testCompile)
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':kotlin-stdlib')
|
|
testCompile project(':kotlin-test:kotlin-test-junit')
|
|
}
|
|
|
|
jar {
|
|
manifestAttributes(manifest, project, 'Main', true)
|
|
from sourceSets.java9.output
|
|
}
|
|
|
|
configureModularJar {
|
|
dependsOn(jar)
|
|
manifestAttributes(manifest, project, 'Main', true)
|
|
|
|
from zipTree(jar.outputs.files.singleFile)
|
|
}
|
|
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
sources sourcesJar
|
|
|
|
archives modularJar
|
|
}
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
|
kotlinOptions.jdkHome = JDK_17
|
|
}
|
|
|
|
compileKotlin {
|
|
kotlinOptions.freeCompilerArgs = [
|
|
"-Xallow-kotlin-package",
|
|
"-Xmultifile-parts-inherit",
|
|
"-Xnormalize-constructor-calls=enable",
|
|
"-Xopt-in=kotlin.RequiresOptIn",
|
|
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
|
"-Xsuppress-deprecated-jvm-target-warning",
|
|
]
|
|
kotlinOptions.moduleName = project.name
|
|
}
|
|
|
|
compileTestKotlin {
|
|
kotlinOptions.freeCompilerArgs = [
|
|
"-Xallow-kotlin-package",
|
|
"-Xmulti-platform",
|
|
"-Xopt-in=kotlin.RequiresOptIn",
|
|
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
|
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
|
"-Xopt-in=kotlin.io.path.ExperimentalPathApi",
|
|
"-Xcommon-sources=${fileTree('../test').join(',')}",
|
|
"-Xsuppress-deprecated-jvm-target-warning",
|
|
]
|
|
}
|
|
|
|
configureJvmIrBackend(project)
|
|
|
|
compileJava9Sources(project, 'kotlin.stdlib.jdk7')
|
|
|
|
test {
|
|
executable = "$JDK_17/bin/java"
|
|
}
|
|
|
|
task testJdk6Tests(type: Test) {
|
|
dependsOn(':kotlin-stdlib:testClasses')
|
|
group = "verification"
|
|
|
|
executable = "$JDK_17/bin/java"
|
|
|
|
doFirst {
|
|
testClassesDirs = project(':kotlin-stdlib').sourceSets.test.output
|
|
classpath = files(
|
|
testClassesDirs,
|
|
sourceSets.test.compileClasspath
|
|
)
|
|
}
|
|
}
|
|
|
|
task testNoJdk7(type: Test, dependsOn: noJdk7TestClasses) {
|
|
group = "verification"
|
|
|
|
executable = "$JDK_17/bin/java"
|
|
|
|
testClassesDirs = sourceSets.noJdk7Test.output.classesDirs
|
|
classpath = sourceSets.noJdk7Test.runtimeClasspath
|
|
}
|
|
|
|
|
|
check.dependsOn testJdk6Tests, testNoJdk7
|
|
|