Build: Fix kotlin-compiler-embeddable test runtime

This commit is contained in:
Vyacheslav Gerasimov
2020-06-14 14:27:17 +03:00
parent ef48c38eb4
commit 38416e7e30
+9 -3
View File
@@ -6,6 +6,14 @@ plugins {
}
val testCompilationClasspath by configurations.creating
val testCompilerClasspath by configurations.creating {
isCanBeConsumed = false
extendsFrom(configurations["runtimeElements"])
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))
}
}
dependencies {
runtimeOnly(kotlinStdlib())
@@ -44,9 +52,7 @@ javadocJar()
projectTest {
dependsOn(runtimeJar)
doFirst {
val runtimeJarConfig = configurations["runtimeJar"]
val runtimeConfig = configurations["runtime"]
systemProperty("compilerClasspath", "${runtimeJarConfig.allArtifacts.files.files.first().path}${File.pathSeparator}${runtimeConfig.asPath}")
systemProperty("compilerClasspath", "${runtimeJar.get().outputs.files.asPath}${File.pathSeparator}${testCompilerClasspath.asPath}")
systemProperty("compilationClasspath", testCompilationClasspath.asPath)
}
}