[repo] Migrate Groovy build scripts to use 'kotlinStdlib()' directly from buildSrc
This commit is contained in:
committed by
Space Team
parent
3629a9db30
commit
5de2b5aeb4
+3
@@ -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)
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,4 @@ allprojects { project ->
|
||||
lambda()
|
||||
}
|
||||
}
|
||||
|
||||
dependencies.ext.kotlinStdlib = { suffix ->
|
||||
DependenciesKt.kotlinStdlib(project, suffix, null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -54,7 +54,7 @@ tasks.register("populateNodeModules", Copy) {
|
||||
}
|
||||
|
||||
node {
|
||||
version = DependenciesKt.getNodejsVersion(project)
|
||||
version = RepoDependencies.getNodejsVersion(project)
|
||||
download = true
|
||||
}
|
||||
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -327,7 +327,7 @@ artifacts {
|
||||
|
||||
node {
|
||||
download = true
|
||||
version = DependenciesKt.getNodejsVersion(project)
|
||||
version = RepoDependencies.getNodejsVersion(project)
|
||||
nodeProjectDir = buildDir
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ sourceSets {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly DependenciesKt.kotlinBuiltins(project)
|
||||
compileOnly RepoDependencies.kotlinBuiltins(project)
|
||||
}
|
||||
|
||||
configureSourcesJar()
|
||||
|
||||
@@ -7,7 +7,7 @@ JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_8)
|
||||
configurePublishing(project)
|
||||
|
||||
dependencies {
|
||||
compileOnly kotlinStdlib()
|
||||
compileOnly RepoDependencies.kotlinStdlib(project)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
Reference in New Issue
Block a user