cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [12/50] git commit: bumping support for 2.2.0
Date Wed, 28 Nov 2012 18:16:23 GMT
bumping support for 2.2.0


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

Branch: refs/heads/master
Commit: bab6419a75db20c1cbd448d8e155e3e543967a94
Parents: a0217d6
Author: Fil Maj <maj.fil@gmail.com>
Authored: Tue Nov 6 15:19:49 2012 -0800
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Tue Nov 6 15:19:49 2012 -0800

----------------------------------------------------------------------
 spec/metadata/ios_parser.spec.js |    2 +-
 src/metadata/ios_parser.js       |    2 +-
 src/util.js                      |   17 ++++++++++++-----
 3 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/bab6419a/spec/metadata/ios_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/ios_parser.spec.js b/spec/metadata/ios_parser.spec.js
index e89dccb..272a710 100644
--- a/spec/metadata/ios_parser.spec.js
+++ b/spec/metadata/ios_parser.spec.js
@@ -131,7 +131,7 @@ describe('ios project parser', function() {
             runs(function() {
                 parser = new ios_parser(ios_platform);
                 parser.update_www();
-                expect(fs.readFileSync(path.join(ios_platform, 'www', 'cordova.js'),'utf-8')).toBe(fs.readFileSync(path.join(__dirname,
'..', '..', 'lib', 'ios', 'bin', 'templates', 'project', 'www', 'cordova-2.2.0rc1.js'), 'utf-8'));
+                expect(fs.readFileSync(path.join(ios_platform, 'www', 'cordova.js'),'utf-8')).toBe(fs.readFileSync(path.join(__dirname,
'..', '..', 'lib', 'ios', 'bin', 'templates', 'project', 'www', 'cordova-2.2.0.js'), 'utf-8'));
             });
         });
     });

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/bab6419a/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index 2531c26..e841bd6 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -56,7 +56,7 @@ module.exports.prototype = {
         var projectRoot = util.isCordova(process.cwd());
         var www = path.join(projectRoot, 'www');
         shell.cp('-rf', www, this.path);
-        var jsPath = path.join(__dirname, '..', '..', 'lib', 'ios', 'bin', 'templates', 'project',
'www', 'cordova-2.2.0rc1.js');
+        var jsPath = path.join(__dirname, '..', '..', 'lib', 'ios', 'bin', 'templates', 'project',
'www', 'cordova-2.2.0.js');
         fs.writeFileSync(path.join(this.path, 'www', 'cordova.js'), fs.readFileSync(jsPath,
'utf-8'), 'utf-8');
     },
     update_project:function(cfg, callback) {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/bab6419a/src/util.js
----------------------------------------------------------------------
diff --git a/src/util.js b/src/util.js
index 51dd2f0..3dca397 100644
--- a/src/util.js
+++ b/src/util.js
@@ -5,6 +5,8 @@ var fs         = require('fs'),
     admzip     = require('adm-zip'),
     shell      = require('shelljs');
 
+var cordova_lib_tag = '2.2.0';
+
 var repos = {
     ios:'https://github.com/apache/incubator-cordova-ios/',
     android:'https://github.com/apache/incubator-cordova-android/',
@@ -33,10 +35,18 @@ module.exports = {
         } else return false;
     },
     // Determines whether the library has a copy of the specified
-    // Cordova implementation
+    // Cordova implementation at the current proper version
     havePlatformLib: function havePlatformLib(platform, callback) {
         var dir = path.join(__dirname, '..', 'lib', module.exports.underlyingLib(platform));
-        return fs.existsSync(dir);
+        if (fs.existsSync(dir)) {
+            var versionFile = path.join(dir, 'VERSION');
+            if (platform == 'ios') versionFile = path.join(dir, 'CordovaLib', 'VERSION');
+            var version = fs.readFileSync(versionFile, 'utf-8').replace(/\s/g,'');
+            if (version != cordova_lib_tag) {
+                shell.rm('-rf', dir);
+                return false;
+            } else return true;
+        } else return false;
     },
     /**
      * checkout a platform from the git repo
@@ -50,9 +60,6 @@ module.exports = {
             throw new Error('platform "' + target + '" not found.');
         }
 
-        // specify which project tag to check out. minimum tag is 2.2.0rc1
-        var cordova_lib_tag = '2.2.0rc1';
-
         var outPath = path.join(__dirname, '..', 'lib', target);
         shell.mkdir('-p', outPath);
 


Mime
View raw message