cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [06/14] cordova-coho git commit: CB-11642 update CDVAvailability.h
Date Mon, 10 Apr 2017 23:14:23 GMT
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/b545b7e8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/b545b7e8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/b545b7e8

Branch: refs/heads/master
Commit: b545b7e8a4efed44cd250bbc9b85e95144210a0c
Parents: 18551f2
Author: juliascript <juliageist23@gmail.com>
Authored: Thu Jul 28 17:44:52 2016 -0700
Committer: audreyso <auso@adobe.com>
Committed: Fri Oct 14 17:01:22 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/b545b7e8/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


Mime
View raw message