Gradle: Update version name policy
This commit is contained in:
@ -9,7 +9,7 @@ dependencies {
|
||||
sourceCompatibility = "1.7"
|
||||
targetCompatibility = "1.7"
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.1.4'
|
||||
ext.kotlin_version = '1.1.51'
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
@ -19,8 +19,12 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
versionNameSuffix "-${getGitHeadRefsSuffix()}"
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
versionNameSuffix "-snatshot-${getGitHeadRefsSuffix()}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 26
|
||||
versionCode 30
|
||||
versionName "1.2.9-snapshot"
|
||||
versionName "1.2.9"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
resConfigs "zh-rCN", "zh-rTW"
|
||||
externalNativeBuild {
|
||||
@ -31,6 +31,10 @@ android {
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
proguardFile 'app/proguard-rules.pro'
|
||||
versionNameSuffix "-${getGitHeadRefsSuffix()}"
|
||||
}
|
||||
debug {
|
||||
versionNameSuffix "-snatshot-${getGitHeadRefsSuffix()}"
|
||||
}
|
||||
}
|
||||
externalNativeBuild {
|
||||
|
23
build.gradle
23
build.gradle
@ -1,7 +1,28 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.1.4'
|
||||
ext.kotlin_version = '1.1.51'
|
||||
ext.getGitHeadRefsSuffix = {
|
||||
try {
|
||||
def headFile = new File('.git/HEAD')
|
||||
if (headFile.exists()) {
|
||||
String[] strings = headFile.getText('UTF-8').split(" ");
|
||||
if (strings.size() > 1) {
|
||||
String refFilePath = '.git/' + strings[1];
|
||||
|
||||
def refFile = new File(refFilePath.replace("\n", ""));
|
||||
|
||||
return refFile.getText('UTF-8').substring(0, 7)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
maven { url 'https://dl.google.com/dl/android/maven2/' }
|
||||
jcenter()
|
||||
|
@ -13,6 +13,10 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
versionNameSuffix "-${getGitHeadRefsSuffix()}"
|
||||
}
|
||||
debug {
|
||||
versionNameSuffix "-snatshot-${getGitHeadRefsSuffix()}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,12 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
versionNameSuffix "-${getGitHeadRefsSuffix()}"
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
versionNameSuffix "-snatshot-${getGitHeadRefsSuffix()}"
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
targetCompatibility 1.8
|
||||
@ -29,7 +33,7 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation 'com.android.support:appcompat-v7:26.0.1'
|
||||
implementation 'com.android.support:appcompat-v7:26.1.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.0'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'
|
||||
|
Reference in New Issue
Block a user