Commit 2f0afa13 by pye52

优化自动构建脚本

parent 06058269
...@@ -35,7 +35,7 @@ task clean(type: Delete) { ...@@ -35,7 +35,7 @@ task clean(type: Delete) {
appPreBuildTask = appPreBuildTasks[0] appPreBuildTask = appPreBuildTasks[0]
} }
} else if (project.name == "daemon") { } else if (project.name == "daemon") {
Set<Task> daemonAssembleReleaseTasks = project.getTasksByName("build", false) Set<Task> daemonAssembleReleaseTasks = project.getTasksByName("assembleRelease", false)
if (!daemonAssembleReleaseTasks.isEmpty()) { if (!daemonAssembleReleaseTasks.isEmpty()) {
daemonBuildTask = daemonAssembleReleaseTasks[0] daemonBuildTask = daemonAssembleReleaseTasks[0]
} }
......
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
def signed = "Daemon.apk"
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion "29.0.3" buildToolsVersion "29.0.3"
...@@ -31,6 +32,7 @@ android { ...@@ -31,6 +32,7 @@ android {
debug { debug {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
} }
release { release {
postprocessing { postprocessing {
...@@ -41,6 +43,7 @@ android { ...@@ -41,6 +43,7 @@ android {
proguardFiles 'proguard-rules.pro' proguardFiles 'proguard-rules.pro'
} }
zipAlignEnabled true zipAlignEnabled true
signingConfig signingConfigs.release
} }
} }
compileOptions { compileOptions {
...@@ -60,7 +63,7 @@ android { ...@@ -60,7 +63,7 @@ android {
.get() .get()
.outputScope .outputScope
.apkDatas .apkDatas
.forEach { apkData -> apkData.outputFileName = "Daemon.apk" } .forEach { apkData -> apkData.outputFileName = signed }
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment