You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/06/20 06:08:33 UTC

[2/2] git commit: Simplify VERSION logic and added windows VERSION updating

Simplify VERSION logic and added windows VERSION updating


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/f36d09d0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/f36d09d0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/f36d09d0

Branch: refs/heads/master
Commit: f36d09d0001a3835e6cd7eaaa736bea2169a2871
Parents: 790d9d0
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jun 20 00:08:09 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Jun 20 00:08:09 2013 -0400

----------------------------------------------------------------------
 coho | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/f36d09d0/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index 325c5f3..0d6dfd2 100755
--- a/coho
+++ b/coho
@@ -54,17 +54,20 @@ var platformRepos = [
         title: 'iOS',
         id: 'ios',
         repoName: 'cordova-ios',
-        cordovaJsPaths: ['CordovaLib/cordova.js']
+        cordovaJsPaths: ['CordovaLib/cordova.js'],
+        versionFilePaths: [path.join('CordovaLib', 'VERSION')]
     }, {
         title: 'BlackBerry',
         id: 'blackberry',
-        repoName: 'cordova-blackberry'
+        repoName: 'cordova-blackberry',
+        versionFilePaths: [path.join('blackberry', 'VERSION'), path.join('blackberry10', 'VERSION')]
     }, {
         title: 'Windows',
         id: 'windows',
         repoName: 'cordova-windows',
         cordovaJsSrcName: 'cordova.windows8.js',
-        cordovaJsPaths: ['windows8/cordova.js', 'windows8/template/www/cordova.js']
+        cordovaJsPaths: ['windows8/cordova.js', 'windows8/template/www/cordova.js'],
+        versionFilePaths: [path.join('windows8', 'VERSION'), path.join('windows8', 'template', 'VERSION')]
     }, {
         title: 'Windows Phone 7',
         id: 'wp7',
@@ -748,19 +751,12 @@ function prepareReleaseBranchCommand() {
                 execHelper('git push --set-upstream ' + repo.remoteName + ' ' + branchName);
             }
             // Update the VERSION files.
-            var versionFilePath = 'VERSION';
-            if (repo.id == 'ios') {
-                versionFilePath = path.join('CordovaLib', 'VERSION');
-            } else if (repo.id == 'blackberry') {
-                versionFilePath = path.join('blackberry', 'VERSION');
-            }
-            if (fs.existsSync(versionFilePath)) {
+            var versionFilePaths = repo.versionFilePaths || ['VERSION'];
+            if (fs.existsSync(versionFilePaths[0])) {
                 console.log(repo.repoName + ': ' + 'Updating VERSION file.');
-                fs.writeFileSync(versionFilePath, version + '\n');
-                if (repo.id == 'blackberry') {
-                    versionFilePath = 'blackberry10/VERSION';
+                versionFilePaths.forEach(function(versionFilePath) {
                     fs.writeFileSync(versionFilePath, version + '\n');
-                }
+                });
                 if (repo.id == 'android') {
                     shjs.sed('-i', /cordovaVersion.*=.*;/, 'cordovaVersion = "' + version + '";', path.join('framework', 'src', 'org', 'apache', 'cordova', 'Device.java'));
                 }