Skip to content

Commit 9a1d35f

Browse files
committed
update gradle files
1 parent 23bd8ef commit 9a1d35f

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

android/app/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ android {
99
applicationId "org.openbot"
1010
minSdkVersion 21
1111
targetSdkVersion 29
12-
versionCode 50
13-
versionName "0.5.0"
12+
versionCode getVersionCode()
13+
versionName getVersionName()
1414
ndk {
1515
abiFilters 'armeabi-v7a', 'arm64-v8a'
1616
}
@@ -148,3 +148,7 @@ dependencies {
148148
implementation 'com.koushikdutta.ion:ion:3.1.0'
149149
implementation 'com.google.code.gson:gson:2.8.6'
150150
}
151+
152+
println("Version Code: " + getVersionCode())
153+
println("Version Name: " + getVersionName())
154+

android/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
ext.versionMajor = 0
3+
ext.versionMinor = 5
4+
ext.versionPatch = 0
5+
ext.getVersionCode = { -> ext.versionMajor * 100 + ext.versionMinor * 10 + ext.versionPatch}
6+
ext.getVersionName = { -> "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"}
7+
28
buildscript {
39
ext.kotlin_version = '1.5.10'
410

android/controller/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ android {
1212
defaultConfig {
1313
minSdkVersion 21
1414
targetSdkVersion 30
15-
versionCode 50
16-
versionName "0.5.0"
15+
versionCode getVersionCode()
16+
versionName getVersionName()
1717

1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919

@@ -81,4 +81,7 @@ dependencies {
8181
// apply plugin: 'com.android.library'
8282
apply plugin: 'com.android.application'
8383
apply plugin: 'kotlin-android'
84-
}
84+
}
85+
86+
println("Version Code: " + getVersionCode())
87+
println("Version Name: " + getVersionName())

0 commit comments

Comments
 (0)