cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/2] git commit: Simplify VERSION logic and added windows VERSION updating
Date Thu, 20 Jun 2013 04:08:33 GMT
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 <agrieve@chromium.org>
Authored: Thu Jun 20 00:08:09 2013 -0400
Committer: Andrew Grieve <agrieve@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'));
                 }


Mime
View raw message