更新应用编译配置,适配类库外放编译时的运行环境。
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
android {
|
||||
def winbollProps = new Properties()
|
||||
def winbollPropsFile = rootProject.file("${winbollFilePath}")
|
||||
assert(winbollPropsFile.exists())
|
||||
if(winbollPropsFile.exists()) {
|
||||
winbollProps.load(new FileInputStream(winbollPropsFile))
|
||||
}
|
||||
|
||||
// 读取秘钥配置文件
|
||||
//
|
||||
@@ -14,11 +15,13 @@ android {
|
||||
//println 'Test keystore path'
|
||||
//println 'KeyProsFile :' + Boolean.toString(keyPropsFile.exists())
|
||||
//assert(false)
|
||||
assert(keyPropsFile.exists())
|
||||
if(keyPropsFile.exists()) {
|
||||
keyProps.load(new FileInputStream(keyPropsFile))
|
||||
}
|
||||
|
||||
// 配置签名
|
||||
signingConfigs {
|
||||
if(keyPropsFile.exists()) {
|
||||
winboll {
|
||||
assert(keyProps['keyAlias'] != null && keyProps['keyPassword'] != null && keyProps['storeFile'] != null && keyProps['storePassword'] != null)
|
||||
keyAlias keyProps['keyAlias']
|
||||
@@ -27,12 +30,18 @@ android {
|
||||
storePassword keyProps['storePassword']
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
if(keyPropsFile.exists()) {
|
||||
signingConfig signingConfigs.winboll
|
||||
}
|
||||
}
|
||||
release {
|
||||
if(keyPropsFile.exists()) {
|
||||
signingConfig signingConfigs.winboll
|
||||
}
|
||||
|
||||
minifyEnabled true // 开启混淆(核心开关)
|
||||
shrinkResources true // 可选:移除无用资源(进一步减小体积)
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), // 官方默认规则(优化版)
|
||||
@@ -298,7 +307,7 @@ android {
|
||||
|
||||
// 如果配置了APK额外输出路径,就复制一份拷贝到额外路径。
|
||||
//
|
||||
if(winbollProps['ExtraAPKOutputPath'] != null ) {
|
||||
if(winbollProps != null && winbollProps['ExtraAPKOutputPath'] != null ) {
|
||||
File apkFile = new File(winbollProps['ExtraAPKOutputPath'])
|
||||
File outCommonDir = apkFile.getParentFile();
|
||||
String commandAPKName = apkFile.getName();
|
||||
|
||||
Reference in New Issue
Block a user