Simplify dependency setup for jvm6 codegen test server
This commit is contained in:
@@ -35,6 +35,8 @@ val testDistProjects = listOf(
|
|||||||
":kotlin-annotations-jvm",
|
":kotlin-annotations-jvm",
|
||||||
":kotlin-annotations-android")
|
":kotlin-annotations-android")
|
||||||
|
|
||||||
|
val testJvm6ServerRuntime by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
depDistProjects.forEach {
|
depDistProjects.forEach {
|
||||||
testCompile(projectDist(it))
|
testCompile(projectDist(it))
|
||||||
@@ -43,7 +45,6 @@ dependencies {
|
|||||||
testCompileOnly(projectDist(":kotlin-test:kotlin-test-jvm"))
|
testCompileOnly(projectDist(":kotlin-test:kotlin-test-jvm"))
|
||||||
testCompileOnly(projectDist(":kotlin-test:kotlin-test-junit"))
|
testCompileOnly(projectDist(":kotlin-test:kotlin-test-junit"))
|
||||||
testCompile(projectTests(":compiler:tests-common"))
|
testCompile(projectTests(":compiler:tests-common"))
|
||||||
testCompile(projectTests(":compiler:tests-common-jvm6"))
|
|
||||||
testCompile(projectTests(":generators:test-generator"))
|
testCompile(projectTests(":generators:test-generator"))
|
||||||
testCompile(project(":compiler:ir.ir2cfg"))
|
testCompile(project(":compiler:ir.ir2cfg"))
|
||||||
testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
|
testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
|
||||||
@@ -59,6 +60,8 @@ dependencies {
|
|||||||
testRuntime(ideaSdkCoreDeps("*.jar"))
|
testRuntime(ideaSdkCoreDeps("*.jar"))
|
||||||
testRuntime(ideaSdkDeps("*.jar"))
|
testRuntime(ideaSdkDeps("*.jar"))
|
||||||
testRuntime(files("${System.getProperty("java.home")}/../lib/tools.jar"))
|
testRuntime(files("${System.getProperty("java.home")}/../lib/tools.jar"))
|
||||||
|
|
||||||
|
testJvm6ServerRuntime(projectTests(":compiler:tests-common-jvm6"))
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -88,8 +91,6 @@ projectTest {
|
|||||||
systemProperty("kotlin.test.script.classpath", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
|
systemProperty("kotlin.test.script.classpath", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
|
||||||
}
|
}
|
||||||
|
|
||||||
evaluationDependsOn(":compiler:tests-common-jvm6")
|
|
||||||
|
|
||||||
fun Project.codegenTest(target: Int, jvm: Int,
|
fun Project.codegenTest(target: Int, jvm: Int,
|
||||||
jdk: String = "JDK_${if (jvm <= 8) "1" else ""}$jvm",
|
jdk: String = "JDK_${if (jvm <= 8) "1" else ""}$jvm",
|
||||||
body: Test.() -> Unit): Test = projectTest("codegenTarget${target}Jvm${jvm}Test") {
|
body: Test.() -> Unit): Test = projectTest("codegenTarget${target}Jvm${jvm}Test") {
|
||||||
@@ -115,7 +116,7 @@ fun Project.codegenTest(target: Int, jvm: Int,
|
|||||||
}
|
}
|
||||||
|
|
||||||
codegenTest(target = 6, jvm = 6, jdk = "JDK_18") {
|
codegenTest(target = 6, jvm = 6, jdk = "JDK_18") {
|
||||||
dependsOn(":compiler:tests-common-jvm6:build")
|
dependsOn(testJvm6ServerRuntime)
|
||||||
|
|
||||||
val port = project.findProperty("kotlin.compiler.codegen.tests.port")?.toString() ?: "5100"
|
val port = project.findProperty("kotlin.compiler.codegen.tests.port")?.toString() ?: "5100"
|
||||||
var jdkProcess: Process? = null
|
var jdkProcess: Process? = null
|
||||||
@@ -125,11 +126,7 @@ codegenTest(target = 6, jvm = 6, jdk = "JDK_18") {
|
|||||||
val jdkPath = project.findProperty("JDK_16") ?: error("JDK_16 is not optional to run this test")
|
val jdkPath = project.findProperty("JDK_16") ?: error("JDK_16 is not optional to run this test")
|
||||||
val executable = "$jdkPath/bin/java"
|
val executable = "$jdkPath/bin/java"
|
||||||
val main = "org.jetbrains.kotlin.test.clientserver.TestProcessServer"
|
val main = "org.jetbrains.kotlin.test.clientserver.TestProcessServer"
|
||||||
|
val classpath = testJvm6ServerRuntime.asPath
|
||||||
val classpath = getSourceSetsFrom(":compiler:tests-common-jvm6")["main"].output.asPath + ":" +
|
|
||||||
getSourceSetsFrom(":kotlin-stdlib")["main"].output.asPath + ":" +
|
|
||||||
getSourceSetsFrom(":kotlin-stdlib")["builtins"].output.asPath + ":" +
|
|
||||||
getSourceSetsFrom(":kotlin-test:kotlin-test-jvm")["main"].output.asPath
|
|
||||||
|
|
||||||
logger.debug("Server classpath: $classpath")
|
logger.debug("Server classpath: $classpath")
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,8 @@ apply { plugin("kotlin") }
|
|||||||
jvmTarget = "1.6"
|
jvmTarget = "1.6"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(project(":core"))
|
compile(project(":kotlin-stdlib"))
|
||||||
testCompile(project(":core::util.runtime"))
|
compile(project(":kotlin-test:kotlin-test-jvm"))
|
||||||
testCompile(project(":compiler:util"))
|
|
||||||
testCompile(project(":compiler:backend"))
|
|
||||||
testCompile(project(":compiler:frontend"))
|
|
||||||
testCompile(project(":compiler:frontend.java"))
|
|
||||||
testCompile(project(":compiler:util"))
|
|
||||||
testCompile(project(":compiler:cli-common"))
|
|
||||||
testCompile(project(":compiler:cli"))
|
|
||||||
testCompile(project(":kotlin-test:kotlin-test-jvm"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
Reference in New Issue
Block a user