Extract kotlin.coroutines.experimental API into compat artifact

Add public API dump for kotlin-coroutines-experimental-compat

#KT-36083
This commit is contained in:
Ilya Gorbunov
2020-01-18 04:54:46 +03:00
parent 075eea5a96
commit b5a0daabc3
15 changed files with 268 additions and 149 deletions
@@ -0,0 +1,94 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
id("jps-compatible")
}
publish()
description = "Kotlin pre 1.3 experimental coroutines compatibility library"
jvmTarget = "1.6"
javaHome = rootProject.extra["JDK_16"] as String
sourceSets {
"main" {
java.srcDirs("src", "jvm/src")
}
"test" {
java.srcDirs("jvm/test")
}
"migrationTest" {
if(!kotlinBuildProperties.isInIdeaSync)
java.srcDirs("jvm/test")
}
}
val migrationTestSourceSet = sourceSets["migrationTest"]
configurations {
"migrationTestImplementation" {
extendsFrom(testImplementation.get())
}
}
dependencies {
api(kotlinStdlib())
testImplementation(project(":kotlin-test:kotlin-test-junit"))
"migrationTestImplementation"(sourceSets.main.get().output)
}
tasks {
val compileKotlin by existing(KotlinCompile::class) {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
freeCompilerArgs = listOf(
"-Xmulti-platform",
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-Xuse-experimental=kotlin.Experimental",
"-Xcoroutines=enable",
"-XXLanguage:-ReleaseCoroutines",
"-Xno-use-ir",
"-module-name", "kotlin-coroutines-experimental-compat"
)
}
}
val compileTestKotlin by existing(KotlinCompile::class) {
kotlinOptions {
languageVersion = "1.2"
apiVersion = "1.2"
freeCompilerArgs = listOf("-Xcoroutines=enable")
}
}
val compileMigrationTestKotlin by existing(KotlinCompile::class) {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
freeCompilerArgs = listOf()
}
}
val migrationTestClasses by existing
val migrationTest by creating(Test::class) {
dependsOn(migrationTestClasses)
group = "verification"
testClassesDirs = migrationTestSourceSet.output.classesDirs
classpath = migrationTestSourceSet.runtimeClasspath
}
val check by existing {
dependsOn(migrationTest)
}
val jar by existing(Jar::class) {
callGroovy("manifestAttributes", manifest, project, "Main")
}
}
sourcesJar()
javadocJar()
@@ -0,0 +1,15 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package test
import kotlin.test.*
inline fun <reified T> assertStaticAndRuntimeTypeIs(value: T) {
@Suppress("USELESS_CAST")
if ((value as Any?) !is T) {
fail("Expected value $value to have ${T::class} type")
}
}