diff options
Diffstat (limited to 'buildSrc/build.gradle.kts')
-rw-r--r-- | buildSrc/build.gradle.kts | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 994e674d..c999bcd2 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,3 +1,7 @@ +/* + * Copyright 2017-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + import java.util.* import java.io.FileInputStream @@ -7,18 +11,34 @@ plugins { repositories { mavenCentral() + mavenLocal() + if (project.hasProperty("kotlin_repo_url")) { + maven(project.properties["kotlin_repo_url"] as String) + } + // kotlin-dev with space redirector + maven("https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") } -val kotlinVersion = FileInputStream(file("../gradle.properties")).use { propFile -> - val ver = Properties().apply { load(propFile) }["kotlin.version"] - require(ver is String) { "kotlin.version must be string in ../gradle.properties, got $ver instead" } - ver +val kotlinVersion = run { + if (project.hasProperty("build_snapshot_train")) { + val ver = project.properties["kotlin_snapshot_version"] as? String + require(!ver.isNullOrBlank()) {"kotlin_snapshot_version must be present if build_snapshot_train is used" } + return@run ver + } + if (project.hasProperty("kotlin_repo_url")) { + val ver = project.properties["kotlin_version"] as? String + require(!ver.isNullOrBlank()) {"kotlin_version must be present if kotlin_repo_url is used" } + return@run ver + } + val targetProp = if (project.hasProperty("bootstrap")) "kotlin.version.snapshot" else "kotlin.version" + FileInputStream(file("../gradle.properties")).use { propFile -> + val ver = project.findProperty("kotlin.version")?.toString() ?: Properties().apply { load(propFile) }[targetProp] + require(ver is String) { "$targetProp must be string in ../gradle.properties, got $ver instead" } + ver + } } dependencies { implementation(kotlin("gradle-plugin", kotlinVersion)) } -kotlinDslPluginOptions { - experimentalWarning.set(false) -} |