diff --git a/buildSrc/src/main/kotlin/dependencies.kt b/buildSrc/src/main/kotlin/repoDependencies.kt similarity index 99% rename from buildSrc/src/main/kotlin/dependencies.kt rename to buildSrc/src/main/kotlin/repoDependencies.kt index 512f05f05be..d0e7175b615 100644 --- a/buildSrc/src/main/kotlin/dependencies.kt +++ b/buildSrc/src/main/kotlin/repoDependencies.kt @@ -3,6 +3,8 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:JvmName("RepoDependencies") + import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.api.artifacts.* @@ -81,6 +83,7 @@ fun Project.preloadedDeps( fun kotlinDep(artifactBaseName: String, version: String, classifier: String? = null): String = listOfNotNull("org.jetbrains.kotlin:kotlin-$artifactBaseName:$version", classifier).joinToString(":") +@JvmOverloads fun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): Any { return if (kotlinBuildProperties.useBootstrapStdlib) kotlinDep(listOfNotNull("stdlib", suffix).joinToString("-"), bootstrapKotlinVersion, classifier) diff --git a/kotlin-native/backend.native/build.gradle b/kotlin-native/backend.native/build.gradle index c5320b55539..b35ae3131eb 100644 --- a/kotlin-native/backend.native/build.gradle +++ b/kotlin-native/backend.native/build.gradle @@ -141,7 +141,7 @@ configurations { dependencies { kotlin_compiler_jar kotlinCompilerModule kotlin_stdlib_jar kotlinStdLibModule - use(DependenciesKt) { + use(RepoDependencies) { trove4j_jar commonDependency("org.jetbrains.intellij.deps:trove4j") kotlin_reflect_jar commonDependency("org.jetbrains.kotlin:kotlin-reflect") compilerApi(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil")) { setTransitive(false) } @@ -252,4 +252,4 @@ publishing { ArtifactsKt.sourcesJar(project) { it.from(sourceSets["cli_bc"].allSource) it.from(sourceSets["compiler"].allSource) -} \ No newline at end of file +} diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 56863e092cb..570c8981d68 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -36,7 +36,7 @@ configurations { dependencies { // TODO: upgrade coroutines to common version - api DependenciesKt.commonDependency(project, "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7") + api RepoDependencies.commonDependency(project, "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7") } ext.testOutputRoot = rootProject.file("test.output").absolutePath @@ -6246,7 +6246,7 @@ dependencies { implementation kotlinCompilerModule api project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements') - api DependenciesKt.commonDependency(project, "junit") + api RepoDependencies.commonDependency(project, "junit") } // Configure build for iOS device targets. diff --git a/kotlin-native/klib/build.gradle b/kotlin-native/klib/build.gradle index 95805bb9bda..9212a7b2ba2 100644 --- a/kotlin-native/klib/build.gradle +++ b/kotlin-native/klib/build.gradle @@ -44,7 +44,7 @@ dependencies { implementation project(":kotlin-stdlib") implementation project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements') implementation project(":kotlin-native:utilities:basic-utils") - testImplementation DependenciesKt.commonDependency(project, "junit") + testImplementation RepoDependencies.commonDependency(project, "junit") testImplementation project(":kotlin-test:kotlin-test-junit") } @@ -60,4 +60,4 @@ test { } classpath = distClasspath + sourceSets.test.runtimeClasspath - sourceSets.main.runtimeClasspath } -} \ No newline at end of file +} diff --git a/libraries/commonConfiguration.gradle b/libraries/commonConfiguration.gradle index bb69976f2f7..52edfefcccf 100644 --- a/libraries/commonConfiguration.gradle +++ b/libraries/commonConfiguration.gradle @@ -86,8 +86,4 @@ allprojects { project -> lambda() } } - - dependencies.ext.kotlinStdlib = { suffix -> - DependenciesKt.kotlinStdlib(project, suffix, null) - } } diff --git a/libraries/examples/kotlin-gradle-subplugin-example/build.gradle b/libraries/examples/kotlin-gradle-subplugin-example/build.gradle index 057e41b1ef8..bf4beb80dbf 100644 --- a/libraries/examples/kotlin-gradle-subplugin-example/build.gradle +++ b/libraries/examples/kotlin-gradle-subplugin-example/build.gradle @@ -24,7 +24,7 @@ dependencies { api project(':kotlin-test:kotlin-test-junit') - compileOnly kotlinStdlib() + compileOnly RepoDependencies.kotlinStdlib(project) compileOnly project(':compiler') compileOnly project(':compiler:plugin-api') compileOnly project(':compiler:cli-common') diff --git a/libraries/kotlin.test/annotations-common/build.gradle b/libraries/kotlin.test/annotations-common/build.gradle index dee9a7a904b..6ba1da12e41 100644 --- a/libraries/kotlin.test/annotations-common/build.gradle +++ b/libraries/kotlin.test/annotations-common/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'kotlin-platform-common' JvmToolchain.updateJvmTarget(project, "1.8") dependencies { - api kotlinStdlib("common") + api RepoDependencies.kotlinStdlib(project, "common") testApi project(":kotlin-test:kotlin-test-common") } diff --git a/libraries/kotlin.test/common/build.gradle b/libraries/kotlin.test/common/build.gradle index 8fb9190a6a6..0b46303e671 100644 --- a/libraries/kotlin.test/common/build.gradle +++ b/libraries/kotlin.test/common/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'kotlin-platform-common' JvmToolchain.updateJvmTarget(project, "1.8") dependencies { - api kotlinStdlib("common") + api RepoDependencies.kotlinStdlib(project, "common") testApi project(":kotlin-test:kotlin-test-annotations-common") } diff --git a/libraries/kotlin.test/js/build.gradle b/libraries/kotlin.test/js/build.gradle index f0ef2b75624..52cec60433c 100644 --- a/libraries/kotlin.test/js/build.gradle +++ b/libraries/kotlin.test/js/build.gradle @@ -10,7 +10,7 @@ configurations { dependencies { expectedBy project(':kotlin-test:kotlin-test-common') expectedBy project(':kotlin-test:kotlin-test-annotations-common') - api kotlinStdlib("js") + api RepoDependencies.kotlinStdlib(project, "js") } compileKotlin2Js { diff --git a/libraries/kotlin.test/js/it/build.gradle b/libraries/kotlin.test/js/it/build.gradle index fed5eac2e86..3c8760d016b 100644 --- a/libraries/kotlin.test/js/it/build.gradle +++ b/libraries/kotlin.test/js/it/build.gradle @@ -54,7 +54,7 @@ tasks.register("populateNodeModules", Copy) { } node { - version = DependenciesKt.getNodejsVersion(project) + version = RepoDependencies.getNodejsVersion(project) download = true } diff --git a/libraries/kotlin.test/jvm/build.gradle b/libraries/kotlin.test/jvm/build.gradle index e8fc50d7223..8b52a69084f 100644 --- a/libraries/kotlin.test/jvm/build.gradle +++ b/libraries/kotlin.test/jvm/build.gradle @@ -16,7 +16,7 @@ sourceSets { dependencies { expectedBy project(':kotlin-test:kotlin-test-common') - api(kotlinStdlib()) + api(RepoDependencies.kotlinStdlib(project)) testApi(project(":kotlin-test:kotlin-test-junit")) testApi('junit:junit:4.13.2') } diff --git a/libraries/reflect/api/build.gradle b/libraries/reflect/api/build.gradle index 7c7689835f0..57cc99764bc 100644 --- a/libraries/reflect/api/build.gradle +++ b/libraries/reflect/api/build.gradle @@ -22,7 +22,7 @@ sourceSets { } dependencies { - api kotlinStdlib() + api RepoDependencies.kotlinStdlib(project) compileOnly project(':core:descriptors') compileOnly project(':core:descriptors.jvm') compileOnly project(':core:deserialization') diff --git a/libraries/stdlib/js-v1/build.gradle b/libraries/stdlib/js-v1/build.gradle index e44f094e4e8..1d365519e12 100644 --- a/libraries/stdlib/js-v1/build.gradle +++ b/libraries/stdlib/js-v1/build.gradle @@ -327,7 +327,7 @@ artifacts { node { download = true - version = DependenciesKt.getNodejsVersion(project) + version = RepoDependencies.getNodejsVersion(project) nodeProjectDir = buildDir } diff --git a/libraries/tools/kotlin-annotations-jvm/build.gradle b/libraries/tools/kotlin-annotations-jvm/build.gradle index 41394344a9c..6810a96b377 100644 --- a/libraries/tools/kotlin-annotations-jvm/build.gradle +++ b/libraries/tools/kotlin-annotations-jvm/build.gradle @@ -15,7 +15,7 @@ sourceSets { } dependencies { - compileOnly DependenciesKt.kotlinBuiltins(project) + compileOnly RepoDependencies.kotlinBuiltins(project) } configureSourcesJar() diff --git a/libraries/tools/script-runtime/build.gradle b/libraries/tools/script-runtime/build.gradle index 7e2534b9aa5..31ca13b1285 100644 --- a/libraries/tools/script-runtime/build.gradle +++ b/libraries/tools/script-runtime/build.gradle @@ -7,7 +7,7 @@ JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_8) configurePublishing(project) dependencies { - compileOnly kotlinStdlib() + compileOnly RepoDependencies.kotlinStdlib(project) } sourceSets {