Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 709E3200BB8 for ; Fri, 30 Sep 2016 02:15:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6F58D160AE3; Fri, 30 Sep 2016 00:15:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8DFDA160AEA for ; Fri, 30 Sep 2016 02:15:31 +0200 (CEST) Received: (qmail 11335 invoked by uid 500); 30 Sep 2016 00:15:30 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 11223 invoked by uid 99); 30 Sep 2016 00:15:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2016 00:15:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 75E6CE02E4; Fri, 30 Sep 2016 00:15:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Fri, 30 Sep 2016 00:15:31 -0000 Message-Id: In-Reply-To: <253e4cc725ff40c3bf8e2b575720da35@git.apache.org> References: <253e4cc725ff40c3bf8e2b575720da35@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/5] cordova-coho git commit: CB-11642 update CDVAvailability.h archived-at: Fri, 30 Sep 2016 00:15:32 -0000 CB-11642 update CDVAvailability.h Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/729fc629 Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/729fc629 Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/729fc629 Branch: refs/heads/master Commit: 729fc62973a5f37a88721baade6e637c490113b5 Parents: 1228273 Author: juliascript Authored: Thu Jul 28 17:44:52 2016 -0700 Committer: audreyso Committed: Thu Sep 29 10:52:41 2016 -0700 ---------------------------------------------------------------------- src/platform-release.js | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/729fc629/src/platform-release.js ---------------------------------------------------------------------- diff --git a/src/platform-release.js b/src/platform-release.js index 10700e7..b016859 100644 --- a/src/platform-release.js +++ b/src/platform-release.js @@ -18,6 +18,8 @@ under the License. */ var path = require('path'); +var fs = require('fs'); +var util = require('util'); var optimist = require('optimist'); var shelljs = require('shelljs'); var apputil = require('./apputil'); @@ -129,8 +131,8 @@ exports.prepareReleaseBranchCommand = function*() { ); var repos = flagutil.computeReposFromFlag(argv.r); + var branchName = null; - // First - perform precondition checks. yield repoupdate.updateRepos(repos, [], true); @@ -153,7 +155,6 @@ exports.prepareReleaseBranchCommand = function*() { yield gitutil.stashAndPop(repo, function*() { // git fetch + update master yield repoupdate.updateRepos([repo], ['master'], false); - // Either create or pull down the branch. if (yield gitutil.remoteBranchExists(repo, branchName)) { print('Remote branch already exists for repo: ' + repo.repoName); @@ -177,6 +178,30 @@ exports.prepareReleaseBranchCommand = function*() { yield versionutil.updateRepoVersion(repo, devVersion); yield updateJsSnapshot(repo, devVersion); yield gitutil.gitCheckout(branchName); + + print(repo.repoName + ': ' + 'Setting VERSION to "' + version + '" on branch + "4.2.x".'); + if (platform == 'ios') { + var iosFile = path.join(__dirname, '..', '..', 'cordova-ios', 'CordovaLib', 'Classes', 'Public', 'CDVAvailability.h'); + var iosFileContents = fs.readFileSync(iosFile, 'utf8'); + iosFileContents = iosFileContents.split('\n'); + + var lineNumberToInsertLine = iosFileContents.indexOf('/* coho:next-version,insert-before */') - 1; + var lineNumberToReplaceLine = iosFileContents.indexOf(' /* coho:next-version-min-required,replace-after */') + 2; + + + var versionNumberUnderscores = version.split('.').join('_'); + var versionNumberZeroes = version.split('.').join('0'); + + var lineToAdd = util.format('#define __CORDOVA_%s %s', versionNumberUnderscores, versionNumberZeroes); + var lineToReplace = util.format(' #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_%s', versionNumberUnderscores); + + iosFileContents.splice(lineNumberToInsertLine, 0, lineToAdd); + iosFileContents[lineNumberToReplaceLine] = lineToReplace; + + fs.writeFileSync(iosFile, iosFileContents.join('\n')); + var update = fs.readFileSync(iosFile, 'utf8'); + console.log(update); + } }); }); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org