[ 
https://issues.apache.org/jira/browse/CB-11642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16241267#comment-16241267
 ] 

ASF GitHub Bot commented on CB-11642:
-------------------------------------

stevengill closed pull request #129: CB-11642 Update CDVAvailability.h 
URL: https://github.com/apache/cordova-coho/pull/129
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/package.json b/package.json
index d801c25..9971755 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,7 @@
     "tape-runner": "^0.3.0"
   },
   "scripts": {
-    "test": "nsp check && node test/test.js | tap-spec"
+    "test": "node test/test.js | tap-spec"
   },
   "repository": {
     "type": "git",
diff --git a/src/platform-release.js b/src/platform-release.js
index a9ebce1..f9e07ba 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');
@@ -131,7 +133,8 @@ exports.prepareReleaseBranchCommand = function*() {
     var repos = flagutil.computeReposFromFlag(argv.r);
     var version = flagutil.validateVersionString(argv.version);
     var branchName = getVersionBranchName(version);
-
+    var platform = repos.id;
+    
     // First - perform precondition checks.
     yield repoupdate.updateRepos(repos, [], true);
 
@@ -139,7 +142,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);
@@ -162,9 +164,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'));
+            }
         });
     });
-
     executil.reportGitPushResult(repos, ['master', branchName]);
 }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Update CDVAvailability.h in coho prepare-release-branch 
> --------------------------------------------------------
>
>                 Key: CB-11642
>                 URL: https://issues.apache.org/jira/browse/CB-11642
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-coho
>         Environment: ios
>            Reporter: Julia Geist
>            Assignee: Audrey So
>            Priority: Trivial
>
> See 
> https://github.com/apache/cordova-coho/blob/master/docs/platforms-release-process.md#for-ios-only
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to