Refactor mock-runtime build to avoid source roots conflicts
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
description = "Kotlin Mock Runtime for Tests"
|
||||
|
||||
@@ -7,12 +8,13 @@ jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
|
||||
dependencies {
|
||||
// compile(projectDist(":kotlin-stdlib"))
|
||||
compile(projectDist(":kotlin-stdlib"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" {
|
||||
// java.apply {
|
||||
java.apply {
|
||||
srcDir(File(buildDir, "src"))
|
||||
// srcDir(File(rootDir, "core", "runtime.jvm", "src"))
|
||||
// .include("kotlin/TypeAliases.kt",
|
||||
// "kotlin/text/TypeAliases.kt")
|
||||
@@ -21,32 +23,47 @@ sourceSets {
|
||||
// "kotlin/jvm/JvmVersion.kt",
|
||||
// "kotlin/util/Standard.kt",
|
||||
// "kotlin/internal/Annotations.kt")
|
||||
// }
|
||||
}
|
||||
}
|
||||
"test" {}
|
||||
}
|
||||
|
||||
val copySources by task<Copy> {
|
||||
from(File(rootDir, "core", "runtime.jvm", "src"))
|
||||
.include("kotlin/TypeAliases.kt",
|
||||
"kotlin/text/TypeAliases.kt")
|
||||
from(File(rootDir, "libraries", "stdlib", "src"))
|
||||
.include("kotlin/collections/TypeAliases.kt",
|
||||
"kotlin/jvm/JvmVersion.kt",
|
||||
"kotlin/util/Standard.kt",
|
||||
"kotlin/internal/Annotations.kt")
|
||||
into(File(buildDir, "src"))
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
dependsOn(copySources)
|
||||
}
|
||||
|
||||
val jar = runtimeJar {
|
||||
dependsOn(":core:builtins:serialize")
|
||||
from(fileTree("${rootProject.extra["distDir"]}/builtins")) { include("kotlin/**") }
|
||||
dependsOn(":kotlin-stdlib:classes")
|
||||
project(":kotlin-stdlib").let { p ->
|
||||
p.pluginManager.withPlugin("java") {
|
||||
from(p.the<JavaPluginConvention>().sourceSets.getByName("main").output) {
|
||||
include("kotlin/**/TypeAliases*.class",
|
||||
"kotlin/jvm/JvmVersion.class",
|
||||
"kotlin/StandardKt*.class",
|
||||
"kotlin/NotImplementedError*.class",
|
||||
"kotlin/internal/*.class")
|
||||
}
|
||||
}
|
||||
}
|
||||
// dependsOn(":kotlin-stdlib:classes")
|
||||
// project(":kotlin-stdlib").let { p ->
|
||||
// p.pluginManager.withPlugin("java") {
|
||||
// from(p.the<JavaPluginConvention>().sourceSets.getByName("main").output) {
|
||||
// include("kotlin/**/TypeAliases*.class",
|
||||
// "kotlin/jvm/JvmVersion.class",
|
||||
// "kotlin/StandardKt*.class",
|
||||
// "kotlin/NotImplementedError*.class",
|
||||
// "kotlin/internal/*.class")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
val distDir: String by rootProject.extra
|
||||
|
||||
Reference in New Issue
Block a user