Skip to content

Commit 84080aa

Browse files
Badyaqwwdfsad
andauthored
Fix CLI property ignored in version resolution (#3663)
Co-authored-by: Vsevolod Tolstopyatov <[email protected]>
1 parent 0238247 commit 84080aa

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

buildSrc/build.gradle.kts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ repositories {
2727
}
2828
}
2929

30-
kotlinDslPluginOptions {
31-
experimentalWarning.set(false)
32-
}
33-
34-
val props = Properties().apply {
30+
val gradleProperties = Properties().apply {
3531
file("../gradle.properties").inputStream().use { load(it) }
3632
}
3733

@@ -41,7 +37,9 @@ fun version(target: String): String {
4137
val snapshotVersion = properties["kotlin_snapshot_version"]
4238
if (snapshotVersion != null) return snapshotVersion.toString()
4339
}
44-
return props.getProperty("${target}_version")
40+
val version = "${target}_version"
41+
// Read from CLI first, used in aggregate builds
42+
return properties[version]?.let{"$it"} ?: gradleProperties.getProperty(version)
4543
}
4644

4745
dependencies {

0 commit comments

Comments
 (0)