diff --git a/backend.native/build.gradle b/backend.native/build.gradle index cfb2efcf501..eec73507f6b 100644 --- a/backend.native/build.gradle +++ b/backend.native/build.gradle @@ -38,17 +38,6 @@ allprojects { repositories { maven { url kotlinCompilerRepo } } - - configurations.all { - // kotlin-compiler module includes Kotlin runtime bundled; - // make Gradle aware of this to avoid multiple Kotlin runtimes in classpath: - resolutionStrategy.dependencySubstitution { - substitute module('org.jetbrains.kotlin:kotlin-runtime') with module(kotlinCompilerModule) - substitute module('org.jetbrains.kotlin:kotlin-stdlib') with module(kotlinStdLibModule) - substitute module('org.jetbrains.kotlin:kotlin-reflect') with module(kotlinReflectModule) - } - // TODO: probably we should use kotlin-compiler without bundled runtime - } } sourceSets { @@ -129,7 +118,10 @@ configurations { kotlin_reflect_jar kotlin_script_runtime_jar - cli_bcRuntime.extendsFrom compilerRuntime + cli_bcRuntime { + extendsFrom compilerRuntime + extendsFrom kotlin_script_runtime_jar + } cli_bc { extendsFrom cli_bcRuntime @@ -149,7 +141,7 @@ dependencies { compilerCompile kotlinNativeInterop['hash'].configuration compilerCompile "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion" - cli_bcCompile "org.jetbrains.kotlin:kotlin-runtime:$buildKotlinVersion" + cli_bcCompile kotlinCompilerModule cli_bcCompile "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion" cli_bcCompile sourceSets.compiler.output diff --git a/settings.gradle b/settings.gradle index 522136dfd54..d5ae33fc481 100644 --- a/settings.gradle +++ b/settings.gradle @@ -33,3 +33,11 @@ include ':platformLibs' includeBuild 'tools/kotlin-native-gradle-plugin' includeBuild 'shared' + +if (hasProperty("kotlinProjectPath")) { + includeBuild(kotlinProjectPath) { + dependencySubstitution { + substitute module('org.jetbrains.kotlin:kotlin-compiler') with project(':include:kotlin-compiler') + } + } +}