Implement property for explicit jvmTarget for script definition...

Apply the property to the default JSR-223 script taking the value from
java.specification.version property, so effectively implementing
jvmTarget detection from current VM.
Also drop enforcing of target 1.8, using common default.
#KT-49329 fixed
#KT-40497 fixed
This commit is contained in:
Ilya Chernikov
2021-12-03 17:29:30 +01:00
committed by TeamCityServer
parent f0316cde54
commit 1450f4d890
6 changed files with 108 additions and 8 deletions
@@ -10,12 +10,21 @@ val embeddableTestRuntime by configurations.creating {
}
}
val testJsr223Runtime by configurations.creating {
extendsFrom(configurations["testRuntimeClasspath"])
}
val testCompilationClasspath by configurations.creating
dependencies {
testApi(commonDep("junit"))
testCompileOnly(project(":kotlin-scripting-jvm-host-unshaded"))
testCompileOnly(project(":compiler:cli"))
testCompileOnly(project(":core:util.runtime"))
testApi(projectTests(":compiler:test-infrastructure-utils"))
testApi(projectTests(":kotlin-scripting-compiler")) { isTransitive = false }
testRuntimeOnly(project(":kotlin-scripting-jsr223-unshaded"))
testRuntimeOnly(project(":kotlin-compiler"))
testRuntimeOnly(project(":kotlin-reflect"))
@@ -24,6 +33,8 @@ dependencies {
embeddableTestRuntime(project(":kotlin-scripting-jsr223"))
embeddableTestRuntime(project(":kotlin-scripting-compiler-embeddable"))
embeddableTestRuntime(testSourceSet.output)
testCompilationClasspath(kotlinStdlib())
}
sourceSets {
@@ -35,7 +46,16 @@ tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
projectTest(parallel = true)
projectTest(parallel = true) {
dependsOn(":dist")
workingDir = rootDir
val testRuntimeProvider = project.provider { testJsr223Runtime.asPath }
val testCompilationClasspathProvider = project.provider { testCompilationClasspath.asPath }
doFirst {
systemProperty("testJsr223RuntimeClasspath", testRuntimeProvider.get())
systemProperty("testCompilationClasspath", testCompilationClasspathProvider.get())
}
}
projectTest(taskName = "embeddableTest", parallel = true) {
workingDir = rootDir