File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ deploy:
4040 file : " ./app/build/outputs/apk/release/app-release.apk"
4141 skip_cleanup : true
4242 on :
43+ tags : true
4344 branch : master
4445
4546after_success :
Original file line number Diff line number Diff line change 33## Deploy
44
551 . update VERSION_NAME in gradle.properties(same as AndroidGodEye)
6- 2 . PUSH master,查看编译状态:[ AndroidGodEyeDemo-travis-ci] ( https://travis-ci.org/Kyson/AndroidGodEyeDemo )
6+ 2 . git tag VERSION_NAME
7+ 3 . push master,查看编译状态:[ AndroidGodEyeDemo-travis-ci] ( https://travis-ci.org/Kyson/AndroidGodEyeDemo )
78
89## Keystore
910
Original file line number Diff line number Diff line change @@ -25,11 +25,20 @@ task clean(type: Delete) {
2525 delete rootProject. buildDir
2626}
2727
28- String [] versionPart = String . valueOf(VERSION_NAME ). split(' \\ .' )
28+ def realVersionName = VERSION_NAME
29+ def TRAVIS_TAG = System . getenv(" TRAVIS_TAG" )
30+ if (TRAVIS_TAG != null && " " != TRAVIS_TAG ) {
31+ realVersionName = TRAVIS_TAG
32+ println " [VERSION] Version name is [" + realVersionName + " ] by git tag."
33+ } else {
34+ println " [VERSION] Version name is [" + realVersionName + " ] by gradle.properties."
35+ }
36+
37+ String [] versionPart = String . valueOf(realVersionName). split(' \\ .' )
2938int realVersionCode = Integer . valueOf(versionPart[0 ]) * 1000000 + Integer . valueOf(versionPart[1 ]) * 1000 + Integer . valueOf(versionPart[2 ])
3039
3140ext {
32- REAL_VERSION_NAME = VERSION_NAME
41+ REAL_VERSION_NAME = realVersionName
3342 REAL_VERSION_CODE = realVersionCode
3443}
3544
You can’t perform that action at this time.
0 commit comments