| @@ -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" | ||||
| } | } | ||||