Selaa lähdekoodia

[编译][更改]:添加版本号管理逻辑

tags/jenkins-front-end-screenad-12
hupeng 6 vuotta sitten
vanhempi
commit
16628a00da
1 muutettua tiedostoa jossa 21 lisäystä ja 2 poistoa
  1. +21
    -2
      android/app/build.gradle

+ 21
- 2
android/app/build.gradle Näytä tiedosto

@@ -98,13 +98,28 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion buildToolsVersion rootProject.ext.buildToolsVersion


def getVersionCode = { ->
return project.hasProperty('versionCode') ? project.versionCode : 1
}

def getVersionName = { ->
return project.hasProperty('versionName') ? project.versionName : "1.0"
}

defaultConfig { defaultConfig {
applicationId "com.screenad" applicationId "com.screenad"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
versionCode = getVersionCode()
versionName getVersionName()
} }

android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "screenad_" + variant.buildType.name + "_v" + defaultConfig.versionName + ".apk"
}
}

splits { splits {
abi { abi {
reset() reset()
@@ -114,7 +129,11 @@ android {
} }
} }
buildTypes { buildTypes {
debug {
buildConfigField "String", "API_HOST", "\"https://mall.youlane.cn/\""//API Host
}
release { release {
buildConfigField "String", "API_HOST", "\"https://admin.malls.iformall.com/\""//API Host
minifyEnabled enableProguardInReleaseBuilds minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
} }


Ladataan…
Peruuta
Tallenna