Skip to content

Commit

Permalink
Fix unsupported mullvad-version gradle execution
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-mullvad committed Dec 10, 2024
1 parent e946529 commit e03ffe4
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions android/buildSrc/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit e03ffe4

Please sign in to comment.