Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0BE4C189DE for ; Thu, 13 Aug 2015 17:40:49 +0000 (UTC) Received: (qmail 24990 invoked by uid 500); 13 Aug 2015 17:40:46 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 24963 invoked by uid 500); 13 Aug 2015 17:40:45 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 24936 invoked by uid 99); 13 Aug 2015 17:40:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2015 17:40:45 +0000 Date: Thu, 13 Aug 2015 17:40:45 +0000 (UTC) From: "Joe Bowser (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CB-9484) Allow option to _not_ copy gradle wrapper on each build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-9484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Bowser resolved CB-9484. ---------------------------- Resolution: Duplicate Being able to update the distributionUrl is exactly what you're looking for. Please check the issue tracker for duplicates, people often ask for the same thing and it's the only critical that's on here right now. > Allow option to _not_ copy gradle wrapper on each build > ------------------------------------------------------- > > Key: CB-9484 > URL: https://issues.apache.org/jira/browse/CB-9484 > Project: Apache Cordova > Issue Type: Improvement > Components: Android > Affects Versions: Master > Environment: Windows, Linux, OSX > Reporter: Mitchell Fuzzle > Priority: Minor > > I want to be able to use a new version of gradle on my Cordova project, but I don't want to have to edit every dev's SDK. It would be awesome if I could just stop Cordova from replacing the gradle wrapper, and then commit my own. > Relevant build.js code: > {code:title=build.js} > }).then(function() { > // Copy the gradle wrapper on each build so that: > // A) we don't require the Android SDK at project creation time, and > // B) we always use the SDK's latest version of it. > var projectPath = ROOT; > // check_reqs ensures that this is set. > var sdkDir = process.env['ANDROID_HOME']; > var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper'); > if (process.platform == 'win32') { > shell.cp('-f', path.join(wrapperDir, 'gradlew.bat'), projectPath); > } else { > shell.cp('-f', path.join(wrapperDir, 'gradlew'), projectPath); > } > 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 we want. > // 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 gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties'); > shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath); > var propertiesFile = opts.buildType + SIGNING_PROPERTIES; > var propertiesFilePath = path.join(ROOT, propertiesFile); > if (opts.packageInfo) { > fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties()); > } else if (isAutoGenerated(propertiesFilePath)) { > shell.rm('-f', propertiesFilePath); > } > }); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org