-
Notifications
You must be signed in to change notification settings - Fork 0
/
versioning.gradle
35 lines (23 loc) · 1.03 KB
/
versioning.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ext {
def buildNumber = Integer.parseInt(System.getenv("BITRISE_BUILD_NUMBER") ?: "0")
buildVersionCode = {
def (major, minor, patch) = mytineVersion.toLowerCase().tokenize('.')
(major, minor, patch) = [major, minor, patch].collect { it.toInteger() }
def versionCode = (major * 100000000) + (minor * 1000000) + (patch * 10000) + buildNumber
println("versionCode = ${versionCode}")
versionCode
}
buildVersionName = {
String taskRequestString = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
println "taskRequestString -> $taskRequestString"
def versionNameSuffix = ""
if (taskRequestString.contains("beta")) {
versionNameSuffix = "-beta${extraVersion}"
} else if (taskRequestString.contains("debug")) {
versionNameSuffix = "-snaphsot"
}
def versionName = "${mytineVersion}.${buildNumber}${versionNameSuffix}"
println("versionName = ${versionName}")
versionName
}
}