You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2014/09/22 22:04:49 UTC
android commit: Added gradle distribution URL updating.
Repository: cordova-android
Updated Branches:
refs/heads/update-gradle-version [created] 5ed2272e5
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/5ed2272e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/5ed2272e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/5ed2272e
Branch: refs/heads/update-gradle-version
Commit: 5ed2272e51c134a9b489240bbadccee5b3d00441
Parents: d022be5
Author: Max Woghiren <ma...@gmail.com>
Authored: Mon Sep 22 16:04:24 2014 -0400
Committer: Max Woghiren <ma...@gmail.com>
Committed: Mon Sep 22 16:04:24 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/5ed2272e/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 2e6a624..41c7d97 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -214,6 +214,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/5ed2272e/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.+'
}
}