diff --git a/build.gradle.kts b/build.gradle.kts index f9750e4b39d..0d318b272fb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,7 +35,14 @@ buildscript { } } + // a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes + // kotlin-stdlib external dependency with local project :kotlin-stdlib in kotlinCompilerClasspath configuration. + // see also configureCompilerClasspath@ + val bootstrapCompilerClasspath by configurations.creating + dependencies { + bootstrapCompilerClasspath(kotlinDep("compiler-embeddable", bootstrapKotlinVersion)) + classpath("com.gradle.publish:plugin-publish-plugin:0.9.7") classpath(kotlinDep("gradle-plugin", bootstrapKotlinVersion)) classpath("net.sf.proguard:proguard-gradle:5.3.3") @@ -353,6 +360,13 @@ allprojects { task("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } } task("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } } } + + run configureCompilerClasspath@ { + val bootstrapCompilerClasspath by rootProject.buildscript.configurations + configurations.findByName("kotlinCompilerClasspath")?.let { + dependencies.add(it.name, files(bootstrapCompilerClasspath)) + } + } } } diff --git a/build.gradle.kts.182 b/build.gradle.kts.182 index e52e185b070..5452b359d62 100644 --- a/build.gradle.kts.182 +++ b/build.gradle.kts.182 @@ -35,7 +35,14 @@ buildscript { } } + // a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes + // kotlin-stdlib external dependency with local project :kotlin-stdlib in kotlinCompilerClasspath configuration. + // see also configureCompilerClasspath@ + val bootstrapCompilerClasspath by configurations.creating + dependencies { + bootstrapCompilerClasspath(kotlinDep("compiler-embeddable", bootstrapKotlinVersion)) + classpath("com.gradle.publish:plugin-publish-plugin:0.9.7") classpath(kotlinDep("gradle-plugin", bootstrapKotlinVersion)) classpath("net.sf.proguard:proguard-gradle:5.3.3") @@ -352,6 +359,13 @@ allprojects { task("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } } task("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } } } + + run configureCompilerClasspath@ { + val bootstrapCompilerClasspath by rootProject.buildscript.configurations + configurations.findByName("kotlinCompilerClasspath")?.let { + dependencies.add(it.name, files(bootstrapCompilerClasspath)) + } + } } }