Added gradle distribution URL updating.

Conflicts:
	bin/templates/cordova/lib/build.js
	framework/build.gradle
This commit is contained in:
Max Woghiren 2014-09-22 16:04:24 -04:00 committed by Andrew Grieve
parent 69a03c2e16
commit ddac192c4a
2 changed files with 9 additions and 0 deletions

View File

@ -223,6 +223,14 @@ var builders = {
shell.mkdir('-p', path.join(projectPath, 'gradle')); shell.mkdir('-p', path.join(projectPath, 'gradle'));
shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), 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);
// Update the version of build.gradle in each dependent library. // Update the version of build.gradle in each dependent library.
var pluginBuildGradle = path.join(projectPath, 'cordova', 'lib', 'plugin-build.gradle'); var pluginBuildGradle = path.join(projectPath, 'cordova', 'lib', 'plugin-build.gradle');
var subProjects = extractSubProjectPaths(); var subProjects = extractSubProjectPaths();

View File

@ -32,6 +32,7 @@ buildscript {
// * framework/build.gradle // * framework/build.gradle
// * bin/templates/project/cordova.gradle // * bin/templates/project/cordova.gradle
// * bin/templates/cordova/lib/plugin-build.gradle // * bin/templates/cordova/lib/plugin-build.gradle
// * distributionUrl within bin/templates/cordova/lib/build.js.
classpath 'com.android.tools.build:gradle:0.12.+' classpath 'com.android.tools.build:gradle:0.12.+'
} }
} }