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:
committed by
Stanislav Erokhin
parent
c796e5338b
commit
5c0cc5f799
@@ -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))
|
||||
@@ -0,0 +1,51 @@
|
||||
description 'Kotlin Runtime (deprecated, use kotlin-stdlib artifact instead)'
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvm6Project(project)
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
|
||||
dependencies {
|
||||
compile group: 'org.jetbrains', name: 'annotations', version:'13.0'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
if(!System.properties.'idea.active') {
|
||||
java {
|
||||
srcDir "${rootDir}/core/builtins/src"
|
||||
srcDir "${rootDir}/libraries/stdlib/jvm/runtime"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
jar {
|
||||
manifestAttributes(manifest, project, 'Main')
|
||||
from("${rootDir}/dist/builtins")
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.kotlin
|
||||
from "${rootDir}/core/builtins/native"
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xnormalize-constructor-calls=enable",
|
||||
"-Xdump-declarations-to=${buildDir}/runtime-declarations.json",
|
||||
"-cp", "${rootDir}/dist/builtins",
|
||||
"-module-name", project.name
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user