summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2024-12-09 17:52:10 +0100
committerAlbin <albin@mullvad.net>2024-12-10 16:43:34 +0100
commite03ffe41b595c9e9723f6606f10ac01ac822fd21 (patch)
treefaad06fe2a88420b5e59969c82f97da2fd2b06a5
parente946529711b30c1a23a7ef890c36545468a5eb2d (diff)
downloadmullvadvpn-e03ffe41b595c9e9723f6606f10ac01ac822fd21.tar.xz
mullvadvpn-e03ffe41b595c9e9723f6606f10ac01ac822fd21.zip
Fix unsupported mullvad-version gradle execution
-rw-r--r--android/buildSrc/src/main/kotlin/Utils.kt21
1 files changed, 7 insertions, 14 deletions
diff --git a/android/buildSrc/src/main/kotlin/Utils.kt b/android/buildSrc/src/main/kotlin/Utils.kt
index a3f3759960..ffea7ce51f 100644
--- a/android/buildSrc/src/main/kotlin/Utils.kt
+++ b/android/buildSrc/src/main/kotlin/Utils.kt
@@ -13,18 +13,11 @@ fun Project.generateVersionName(localProperties: Properties): String {
}
private fun Project.execVersionCodeCargoCommand() =
- execWithOutput { commandLine("cargo", "run", "-q", "--bin", "mullvad-version", "versionCode") }
- .toInt()
+ providers.exec {
+ commandLine("cargo", "run", "-q", "--bin", "mullvad-version", "versionCode")
+ }.standardOutput.asText.get().trim().toInt()
-private fun Project.execVersionNameCargoCommand() = execWithOutput {
- commandLine("cargo", "run", "-q", "--bin", "mullvad-version", "versionName")
-}
-
-private fun Project.execWithOutput(spec: ExecSpec.() -> Unit) =
- ByteArrayOutputStream().use { outputStream ->
- exec {
- this.spec()
- this.standardOutput = outputStream
- }
- outputStream.toString().trim()
- }
+private fun Project.execVersionNameCargoCommand() =
+ providers.exec {
+ commandLine("cargo", "run", "-q", "--bin", "mullvad-version", "versionName")
+ }.standardOutput.asText.get().trim()