Move deprecated kotlin-runtime and reduced runtime for tests into stdlib

Rename mock-runtime-for-test project to kotlin-stdlib:jvm-minimal-for-test
This commit is contained in:
Ilya Gorbunov
2018-02-06 08:51:17 +03:00
committed by Stanislav Erokhin
parent c796e5338b
commit 5c0cc5f799
11 changed files with 14 additions and 13 deletions
@@ -0,0 +1,56 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
description = "Kotlin Mock Runtime for Tests"
apply { plugin("kotlin") }
jvmTarget = "1.6"
javaHome = rootProject.extra["JDK_16"] as String
dependencies {
compileOnly(project(":kotlin-stdlib"))
}
sourceSets {
"main" {
java.apply {
srcDir(File(buildDir, "src"))
}
}
"test" {}
}
val copySources by task<Copy> {
from(project(":kotlin-stdlib").projectDir.resolve("jvm/runtime"))
.include("kotlin/TypeAliases.kt",
"kotlin/text/TypeAliases.kt")
from(project(":kotlin-stdlib").projectDir.resolve("src"))
.include("kotlin/collections/TypeAliases.kt",
"kotlin/jvm/JvmVersion.kt",
"kotlin/util/Standard.kt",
"kotlin/internal/Annotations.kt",
"kotlin/internal/contracts/ContractBuilder.kt",
"kotlin/internal/contracts/Effect.kt")
into(File(buildDir, "src"))
}
tasks.withType<JavaCompile> {
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
}
tasks.withType<KotlinCompile> {
dependsOn(copySources)
kotlinOptions {
freeCompilerArgs += listOf("-module-name", "kotlin-stdlib")
}
}
val jar = runtimeJar {
dependsOn(":core:builtins:serialize")
from(fileTree("${rootProject.extra["distDir"]}/builtins")) { include("kotlin/**") }
}
val distDir: String by rootProject.extra
dist(targetName = "kotlin-stdlib-minimal-for-test.jar", targetDir = File(distDir))
@@ -29,7 +29,7 @@ class RuntimePublicAPITest {
val testName = TestName()
@Test fun kotlinRuntime() {
snapshotAPIAndCompare("../../tools/runtime/build/libs", "kotlin-runtime", listOf("../runtime-declarations.json"), listOf("kotlin.jvm.internal"))
snapshotAPIAndCompare("../../stdlib/runtime/build/libs", "kotlin-runtime", listOf("../runtime-declarations.json"), listOf("kotlin.jvm.internal"))
}
//@Ignore("No more original stdlib jar is produced")