Skip to content

Commit

Permalink
Allow override kotlin_version via -P for buildSrc (#2553)
Browse files Browse the repository at this point in the history
  • Loading branch information
erokhins authored Jul 14, 2021
1 parent 1f8fabd commit 987f43d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

import org.jetbrains.kotlin.utils.addToStdlib.*
import java.util.*

plugins {
Expand Down Expand Up @@ -33,14 +34,14 @@ fun version(target: String): String {
val snapshotVersion = properties["kotlin_snapshot_version"]
if (snapshotVersion != null) return snapshotVersion.toString()
}

return props.getProperty("${target}_version")
return properties["${target}_version"].safeAs<String>() ?: props.getProperty("${target}_version")
}

sourceSets.main {
}

dependencies {
println("Used kotlin version in buildSrc: " + version("kotlin"))
implementation(kotlin("gradle-plugin", version("kotlin")))
implementation("com.moowork.gradle:gradle-node-plugin:1.3.1")
}

0 comments on commit 987f43d

Please sign in to comment.