From 9853a15163d3e4d47865ecb414e54844146f3d74 Mon Sep 17 00:00:00 2001 From: Malte Legenhausen Date: Fri, 17 Jul 2015 15:51:10 +0200 Subject: [PATCH] cdvBuildMultipleApks casting fixed Casting `cdvBuildMultipleApks` via `!!` does not work when you want to modify the build process via the command line. The problem can be simply reproduced when running: `cordova build android -- --gradleArg=-PcdvBuildMultipleApks=false`. The expected output would be a build with a single apk. But the result is a build with multiple apks cause `!!"false"` is `true`. This fix solves the problem by using an more mature casting process that also can handle string that contain the value `"false"`. --- bin/templates/project/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle index e40af3056..289b7afa6 100644 --- a/bin/templates/project/build.gradle +++ b/bin/templates/project/build.gradle @@ -118,7 +118,7 @@ if (ext.cdvReleaseSigningPropertiesFile == null && file('release-signing.propert } // Cast to appropriate types. -ext.cdvBuildMultipleApks = !!cdvBuildMultipleApks; +ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean(); ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : Integer.parseInt('' + cdvMinSdkVersion) ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode)