0925e1b497
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.)
117 lines
2.7 KiB
Groovy
117 lines
2.7 KiB
Groovy
description = 'Kotlin Standard Library JDK 7 extension'
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_7)
|
|
JvmToolchain.updateJvmTarget(project, "1.6")
|
|
|
|
configurePublishing(project)
|
|
configureSourcesJar()
|
|
configureJavadocJar()
|
|
|
|
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
|
|
}
|
|
|
|
compileKotlin {
|
|
kotlinOptions.freeCompilerArgs = [
|
|
"-Xallow-kotlin-package",
|
|
"-Xmultifile-parts-inherit",
|
|
"-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",
|
|
]
|
|
}
|
|
|
|
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk7')
|
|
|
|
task testJdk6Tests(type: Test) {
|
|
dependsOn(':kotlin-stdlib:testClasses')
|
|
group = "verification"
|
|
|
|
doFirst {
|
|
testClassesDirs = project(':kotlin-stdlib').sourceSets.test.output
|
|
classpath = files(
|
|
testClassesDirs,
|
|
sourceSets.test.compileClasspath
|
|
)
|
|
}
|
|
}
|
|
|
|
task testNoJdk7(type: Test, dependsOn: noJdk7TestClasses) {
|
|
group = "verification"
|
|
|
|
testClassesDirs = sourceSets.noJdk7Test.output.classesDirs
|
|
classpath = sourceSets.noJdk7Test.runtimeClasspath
|
|
}
|
|
|
|
check.dependsOn testJdk6Tests, testNoJdk7
|
|
|