You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/08/19 18:03:16 UTC

[10/19] android commit: CB-3445 Speed up gradle building (incremental builds go from 10s -> 1.5s for me)

CB-3445 Speed up gradle building (incremental builds go from 10s -> 1.5s for me)

Biggest win is disabling the linter.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/effffcba
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/effffcba
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/effffcba

Branch: refs/heads/4.0.x
Commit: effffcba1db5aa847b2dc9d382d8680f6873ce29
Parents: 404ce8b
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Aug 18 14:16:27 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Aug 18 14:17:34 2014 -0400

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/effffcba/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 3d0ae87..1f0cd23 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -102,7 +102,22 @@ module.exports.builders = {
     },
     gradle: {
         getArgs: function(cmd) {
+            var lintSteps = [
+                'lint',
+                'lintVitalRelease',
+                'compileLint',
+                'copyReleaseLint',
+                'copyDebugLint'
+            ];
             var args = [cmd, '-b', path.join(ROOT, 'build.gradle')];
+            // 10 seconds -> 6 seconds
+            args.push('-Dorg.gradle.daemon=true');
+            // Excluding lint: 6s-> 1.6s
+            for (var i = 0; i < lintSteps.length; ++i) {
+                args.push('-x', lintSteps[i]);
+            }
+            // Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
+            // args.push('-Dorg.gradle.parallel=true');
             return args;
         },