cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/2] js commit: Change build stamp again by having it use only VERSION file on master branch
Date Tue, 17 Sep 2013 14:11:28 GMT
Change build stamp again by having it use only VERSION file on master branch

This will have it show "3.2.0-dev-HASH" on master even though there is
no "3.2.0-dev" git tag.
(cherry picked from commit 8e5a2e730da70b8a8f597c7fba9bc328e0d89546)


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

Branch: refs/heads/3.1.x
Commit: 7e798f2a8bf1caf2b3bb9f86accf7c673f732799
Parents: 968f501
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Sep 17 10:09:33 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Sep 17 10:10:46 2013 -0400

----------------------------------------------------------------------
 build/packager.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7e798f2a/build/packager.js
----------------------------------------------------------------------
diff --git a/build/packager.js b/build/packager.js
index 6c325c4..39bfcce 100644
--- a/build/packager.js
+++ b/build/packager.js
@@ -30,9 +30,10 @@ packager.computeCommitId = function(callback) {
         callback(cachedGitVersion);
         return;
     }
-    if (fs.existsSync('.git')) {
+    var versionFileId = fs.readFileSync('VERSION', { encoding: 'utf8' }).trim();
+    if (/-dev$/.test(versionFileId) && fs.existsSync('.git')) {
         var gitPath = 'git';
-        var args = 'describe --tags';
+        var args = 'rev-list HEAD --max-count=1 --abbrev-commit';
         childProcess.exec(gitPath + ' ' + args, function(err, stdout, stderr) {
             var isWindows = process.platform.slice(0, 3) == 'win';
             if (err && isWindows) {
@@ -41,13 +42,13 @@ packager.computeCommitId = function(callback) {
                     if (err) {
                         error(err);
                     } else {
-                        done(stdout);
+                        done(versionFileId + '-' + stdout);
                     }
                 });
             } else if (err) {
                 error(err);
             } else {
-                done(stdout);
+                done(versionFileId + '-' + stdout);
             }
         });
     } else {


Mime
View raw message