Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan committed Jul 1, 2024
2 parents a6d579b + 0793353 commit 4eb55db
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions buildSrc/src/main/kotlin/ProjectSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,24 @@ object ProjectSettings {
private fun isCI() = System.getenv("CI") == "true"

@Suppress("TooGenericExceptionCaught", "UnstableApiUsage")
private fun Project.setIOSVersion(versionName: String) = try {
providers.exec {
workingDir = File("${rootDir}/ios")
commandLine("agvtool new-version -all ${getVersionCode(this@setIOSVersion)}".split(" "))
}.standardOutput.asText.get() // needed for completing the execution
providers.exec {
workingDir = File("${rootDir}/ios")
commandLine("agvtool new-marketing-version $versionName".split(" "))
}.standardOutput.asText.get() // needed for completing the execution
} catch (e: Exception) {
println("agvtool exist only mac environment")
println(e.localizedMessage)
private fun Project.setIOSVersion(versionName: String) {
if (System.getProperty("os.name").contains("Mac")) {
providers.exec {
workingDir = File("$rootDir/ios")
commandLine("agvtool new-version -all ${getVersionCode(this@setIOSVersion)}".split(" "))
}.also {
// needed for completing the execution
println("agvtool new-version -all ${it.standardOutput.asText.get()}")
}
providers.exec {
workingDir = File("$rootDir/ios")
commandLine("agvtool new-marketing-version $versionName".split(" "))
}.also {
// needed for completing the execution
println("agvtool new-marketing-version ${it.standardOutput.asText.get()}")
}
} else {
println("agvtool exist only mac environment")
}
}
}

0 comments on commit 4eb55db

Please sign in to comment.