diff options
author | Trumeet <liangyuteng12345@gmail.com> | 2018-11-25 21:14:42 -0800 |
---|---|---|
committer | Trumeet <liangyuteng12345@gmail.com> | 2018-11-25 21:14:42 -0800 |
commit | 5a9c7a96b94369d6483233afc411be66f05b8de5 (patch) | |
tree | ffc555baafd7ea48ded8a6c760abc7c41a97c9d2 | |
parent | c5f5c348be705d88ed731e335eb102fccc7f5880 (diff) | |
download | SysUIController-5a9c7a96b94369d6483233afc411be66f05b8de5.tar SysUIController-5a9c7a96b94369d6483233afc411be66f05b8de5.tar.gz SysUIController-5a9c7a96b94369d6483233afc411be66f05b8de5.tar.bz2 SysUIController-5a9c7a96b94369d6483233afc411be66f05b8de5.zip |
feat(app): use git commit count as version
-rw-r--r-- | app/build.gradle | 4 | ||||
-rw-r--r-- | build.gradle | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/app/build.gradle b/app/build.gradle index f2bc5db..5a4ce5b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "moe.yuuta.sysuicontroller" minSdkVersion 21 targetSdkVersion 28 - versionCode 1 - versionName "0.1 α" + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/build.gradle b/build.gradle index 5692885..2fdcfaf 100644 --- a/build.gradle +++ b/build.gradle @@ -30,3 +30,10 @@ allprojects { task clean(type: Delete) { delete rootProject.buildDir } + +def gitCommitCount = 'git rev-list --count HEAD'.execute([], project.rootDir).text.trim() + +ext { + versionName = "0.${gitCommitCount} α" + versionCode = Integer.parseInt("${gitCommitCount}") +}
\ No newline at end of file |