From 16628a00da25b679d0b6a5e7ddb6c025e28ad7ce Mon Sep 17 00:00:00 2001 From: hupeng Date: Wed, 27 Feb 2019 17:46:14 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=BC=96=E8=AF=91][=E6=9B=B4=E6=94=B9]:?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9C=AC=E5=8F=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 890edbe..b59a139 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,13 +98,28 @@ android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + def getVersionCode = { -> + return project.hasProperty('versionCode') ? project.versionCode : 1 + } + + def getVersionName = { -> + return project.hasProperty('versionName') ? project.versionName : "1.0" + } + defaultConfig { applicationId "com.screenad" minSdkVersion rootProject.ext.minSdkVersion 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 { abi { reset() @@ -114,7 +129,11 @@ android { } } buildTypes { + debug { + buildConfigField "String", "API_HOST", "\"https://mall.youlane.cn/\""//API Host + } release { + buildConfigField "String", "API_HOST", "\"https://admin.malls.iformall.com/\""//API Host minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" }