From 533677df8b5d07903c8e70e1351d922d41ba18a8 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Tue, 16 Sep 2014 14:13:49 -0400 Subject: [PATCH] CB-7512 Speed up gradle builds by building debug or release (not both) --- bin/templates/cordova/lib/build.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js index 585b7af6..e63e3425 100644 --- a/bin/templates/cordova/lib/build.js +++ b/bin/templates/cordova/lib/build.js @@ -176,6 +176,11 @@ var builders = { 'copyDebugLint' ]; } + if (cmd == 'debug') { + cmd = 'assembleDebug'; + } else if (cmd == 'release') { + cmd = 'assembleRelease'; + } var args = [cmd, '-b', path.join(ROOT, 'build.gradle')]; // 10 seconds -> 6 seconds args.push('-Dorg.gradle.daemon=true'); @@ -216,7 +221,7 @@ var builders = { build: function(build_type) { var builder = this; var wrapper = path.join(ROOT, 'gradlew'); - var args = builder.getArgs('build'); + var args = this.getArgs(build_type == 'debug' ? 'debug' : 'release'); return Q().then(function() { return spawn(wrapper, args); }).then(function() {