From 38416e7e3099575d337a6f91cdf252461328960b Mon Sep 17 00:00:00 2001 From: Vyacheslav Gerasimov Date: Sun, 14 Jun 2020 14:27:17 +0300 Subject: [PATCH] Build: Fix kotlin-compiler-embeddable test runtime --- prepare/compiler-embeddable/build.gradle.kts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/prepare/compiler-embeddable/build.gradle.kts b/prepare/compiler-embeddable/build.gradle.kts index 62fd559eb54..496cc24eea3 100644 --- a/prepare/compiler-embeddable/build.gradle.kts +++ b/prepare/compiler-embeddable/build.gradle.kts @@ -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) } }