From 7a267afeaebc52840715ee64423677dc82b7e213 Mon Sep 17 00:00:00 2001 From: cristiangarcia Date: Thu, 16 Nov 2023 11:55:22 +0100 Subject: [PATCH] Assert build.number is present if deployVersion is KTI-1454 Fail instead of producing the wrong artifacts --- build.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 258262fc047..bba299e9fe1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,6 +62,9 @@ pill { val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild val defaultSnapshotVersion: String by extra +findProperty("deployVersion")?.let { + assert(findProperty("build.number") != null) { "`build.number` parameter is expected to be explicitly set with the `deployVersion`" } +} val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion) val kotlinVersion by extra( findProperty("deployVersion")?.toString()?.let { deploySnapshotStr ->