Repository: cordova-android Updated Branches: refs/heads/4.0.x 95815a558 -> b09f97323
Added gradle distribution URL updating. Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/b09f9732 Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/b09f9732 Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/b09f9732 Branch: refs/heads/4.0.x Commit: b09f9732311d5a64879b7730d758bd7e1ba318b3 Parents: 95815a5 Author: Max Woghiren <[email protected]> Authored: Mon Sep 22 16:04:24 2014 -0400 Committer: Max Woghiren <[email protected]> Committed: Mon Sep 22 16:47:01 2014 -0400 ---------------------------------------------------------------------- bin/templates/cordova/lib/build.js | 8 ++++++++ framework/build.gradle | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b09f9732/bin/templates/cordova/lib/build.js ---------------------------------------------------------------------- diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js index 18a2f3b..233c12b 100644 --- a/bin/templates/cordova/lib/build.js +++ b/bin/templates/cordova/lib/build.js @@ -222,6 +222,14 @@ var builders = { shell.rm('-rf', path.join(projectPath, 'gradle', 'wrapper')); shell.mkdir('-p', path.join(projectPath, 'gradle')); shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(projectPath, 'gradle')); + + // If the gradle distribution URL is set, make sure it points to version 1.12. + // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with. + // For some reason, using ^ and $ don't work. This does the job, though. + var distributionUrlRegex = /distributionUrl.*zip/; + var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-1.12-all.zip'; + var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties'); + shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath); }); }, http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b09f9732/framework/build.gradle ---------------------------------------------------------------------- diff --git a/framework/build.gradle b/framework/build.gradle index 6ca284d..a0fb2d2 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -29,7 +29,9 @@ buildscript { // It can affect things like where the .apk is generated. // It also dictates what the minimum android build-tools version // that you need (Set in bin/templates/project/cordova.gradle). - // Be sure to also update the value in bin/templates/project. + // Be sure to also update the value in: + // (1) bin/templates/project/build.gradle, and + // (2) the distribution URL in bin/templates/cordova/lib/build.js. classpath 'com.android.tools.build:gradle:0.12.+' } }
