Skip to content

Commit

Permalink
fix(core): use try catch to assign outputFile value
Browse files Browse the repository at this point in the history
fix #323
fix #324
  • Loading branch information
simpleton committed Apr 22, 2019
1 parent 13d31bf commit 9ec65d6
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ class AndResGuardTask extends DefaultTask {
variant.productFlavors, variant.buildType.name) ||
variantName.equalsIgnoreCase(AndResGuardPlugin.USE_APK_TASK_NAME)) {

def outputFile
if (variant.metaClass.respondsTo(variant, "getPackageApplicationProvider")) {
outputFile = { File(variant.packageApplicationProvider.get().outputDirectory, output.outputFileName) }
} else {
outputFile = output.outputFile
def outputFile = null
try {
if (variant.metaClass.respondsTo(variant, "getPackageApplicationProvider")) {
outputFile = new File(variant.packageApplicationProvider.get().outputDirectory, output.outputFileName)

This comment has been minimized.

Copy link
@soha1018

soha1018 May 7, 2019

这里是不是少写一个大括号

}
} catch (Exception ignore) {
// no-op
} finally {
outputFile = outputFile ?: output.outputFile
}

buildConfigs << new BuildInfo(
Expand Down

0 comments on commit 9ec65d6

Please sign in to comment.