From 84080aa69b04a5b701b615357bfbbed08030ecf0 Mon Sep 17 00:00:00 2001 From: Bogdan Mukvich Date: Thu, 1 Jun 2023 18:51:06 +0200 Subject: [PATCH] Fix CLI property ignored in version resolution (#3663) Co-authored-by: Vsevolod Tolstopyatov --- buildSrc/build.gradle.kts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index c37ac64d0b..ae54ad0f66 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -27,11 +27,7 @@ repositories { } } -kotlinDslPluginOptions { - experimentalWarning.set(false) -} - -val props = Properties().apply { +val gradleProperties = Properties().apply { file("../gradle.properties").inputStream().use { load(it) } } @@ -41,7 +37,9 @@ fun version(target: String): String { val snapshotVersion = properties["kotlin_snapshot_version"] if (snapshotVersion != null) return snapshotVersion.toString() } - return props.getProperty("${target}_version") + val version = "${target}_version" + // Read from CLI first, used in aggregate builds + return properties[version]?.let{"$it"} ?: gradleProperties.getProperty(version) } dependencies {