Skip to content

Commit

Permalink
CB-9402 Allow to set gradle distubutionUrl via env variable CORDOVA_A…
Browse files Browse the repository at this point in the history
…NDROID_GRADLE_DISTRIBUTION_URL

This closes apache#205
  • Loading branch information
alebedev authored and infil00p committed Aug 14, 2015
1 parent 9e40091 commit b1dadaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/templates/cordova/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ var builders = {
// 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-2.2.1-all.zip';
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://services.gradle.org/distributions/gradle-2.2.1-all.zip';
var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath);
shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath);
shell.sed('-i', distributionUrlRegex, 'distributionUrl='+distributionUrl, gradleWrapperPropertiesPath);

var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
var propertiesFilePath = path.join(ROOT, propertiesFile);
Expand Down

0 comments on commit b1dadaf

Please sign in to comment.