-
Notifications
You must be signed in to change notification settings - Fork 36
/
configurations.gradle
41 lines (37 loc) · 1.16 KB
/
configurations.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
36
37
38
39
40
41
ext {
javaVersion = JavaVersion.VERSION_18
jvmToolchainVersion = 18
androidConfig = [
minSdkVersion : 21,
targetSdkVersion : 34,
compileSdkVersion: 34
]
/**
* Build number (currently not available in JitPack).
*/
getBuildNumber = { ->
return System.getenv()["buildNumber"] as Integer ?: 0
}
/**
* Version code: MMMmmppbbb
*/
generateVersionCode = { versionMajor, versionMinor, versionPatch ->
Integer versionCode = versionMajor * 10000000 +
versionMinor * 100000 +
versionPatch * 1000 +
(getBuildNumber() % 1000)
println "Version code: " + versionCode
return versionCode
}
/**
* Version name: <major>.<minor>.<patch>[-<verClass>]
*/
generateVersionName = { versionMajor, versionMinor, versionPatch, versionClassifier ->
String versionName = "${versionMajor}.${versionMinor}.${versionPatch}"
if (versionClassifier != null) {
versionName += "-" + versionClassifier
}
println "Version name: " + versionName
return versionName
}
}