我想构建一个gradle Exec任务,在我签名的apk文件上运行android的zipalign,然后验证对齐。
答案 0 :(得分:1)
<强>变量强>:
zipalign任务:
task zipAlign(type: Exec) {
executable "${ANDROID_HOME}${ZIPALIGN_PATH}"
args "-f", "-v", "4", "${buildDir}${OUTPUT_APK_PATH}${APK_FILE_TO_ALIGN}", "${buildDir}${OUTPUT_APK_PATH}${APK_FILE_NAME}"
}
zipalign验证任务(请注意,此任务取决于zipalign任务):
task verifyZipAlign(type: Exec, dependsOn: 'zipAlign') {
executable "${ANDROID_HOME}${ZIPALIGN_PATH}"
args "-c", "-v", "4", "${buildDir}${OUTPUT_APK_PATH}${APK_FILE_NAME}"
}