cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject git commit: npm version 2.8.19. Fixes [CB-3814] use 2.8.1 for android. Refactored to allow per-platform-library versioning.
Date Fri, 14 Jun 2013 21:04:41 GMT
Updated Branches:
  refs/heads/master2 9d28a67d6 -> b09847a8b


npm version 2.8.19. Fixes [CB-3814] use 2.8.1 for android. Refactored to allow per-platform-library
versioning.


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

Branch: refs/heads/master2
Commit: b09847a8bef5be07a5da22d112a97b7cb34ce088
Parents: 9d28a67
Author: Fil Maj <maj.fil@gmail.com>
Authored: Fri Jun 14 14:04:33 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Jun 14 14:04:33 2013 -0700

----------------------------------------------------------------------
 package.json                         |  2 +-
 platforms.js                         | 18 ++++++++++++------
 spec/metadata/android_parser.spec.js |  2 +-
 spec/platform.spec.js                |  7 +++++--
 src/create.js                        |  3 ++-
 src/lazy_load.js                     |  4 ++--
 src/metadata/android_parser.js       |  4 ++--
 src/metadata/blackberry_parser.js    |  2 +-
 src/metadata/ios_parser.js           |  2 +-
 src/metadata/wp7_parser.js           |  4 ++--
 src/metadata/wp8_parser.js           |  4 ++--
 src/platform.js                      |  2 +-
 src/util.js                          |  3 ---
 13 files changed, 32 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index e3f27a9..24549a2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova",
-  "version": "2.8.18",
+  "version": "2.8.19",
   "preferGlobal": "true",
   "description": "Cordova command line interface tool",
   "main": "cordova",

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/platforms.js
----------------------------------------------------------------------
diff --git a/platforms.js b/platforms.js
index 0096fcb..6092fe4 100644
--- a/platforms.js
+++ b/platforms.js
@@ -20,25 +20,31 @@
 module.exports = {
     'ios' : {
         parser : require('./src/metadata/ios_parser'),
-        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git'
+        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git',
+        version: '2.8.0'
     }, 
     'android' : {
         parser : require('./src/metadata/android_parser'),
-        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
+        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git',
+        version: '2.8.1'
     }, 
     'wp7' : {
         parser : require('./src/metadata/wp7_parser'),
-        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-wp7.git'
+        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-wp7.git',
+        version: '2.8.0'
     },
     'wp8' : {
         parser : require('./src/metadata/wp8_parser'),
-        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-wp8.git'
+        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-wp8.git',
+        version: '2.8.0'
     },
     blackberry : {
         parser : require('./src/metadata/blackberry_parser'),
-        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-blackberry.git'
+        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-blackberry.git',
+        version: '2.8.0'
     },
     'www':{
-        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git'
+        url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git',
+        version: '2.8.0'
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/spec/metadata/android_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/android_parser.spec.js b/spec/metadata/android_parser.spec.js
index 6a890aa..e84a3ec 100644
--- a/spec/metadata/android_parser.spec.js
+++ b/spec/metadata/android_parser.spec.js
@@ -81,7 +81,7 @@ describe('android project parser', function() {
                 done();
             });
         });
-        it('should check that we can update an android project by calling `android update
project`', function(done) {
+        it('should check that we can update an android project by calling `android update
project` on stock android path', function(done) {
             platforms.android.parser.check_requirements(proj, function(err) {
                 expect(err).toEqual(false);
                 expect(exec.mostRecentCall.args[0]).toMatch(/^android update project -p .*
-t android-17$/gi);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/spec/platform.spec.js
----------------------------------------------------------------------
diff --git a/spec/platform.spec.js b/spec/platform.spec.js
index 3205811..28499b1 100644
--- a/spec/platform.spec.js
+++ b/spec/platform.spec.js
@@ -118,9 +118,12 @@ describe('platform command', function() {
             });
         });
         describe('`add`', function() {
-            it('should shell out to specified platform\'s bin/create', function() {
+            it('should shell out to specified platform\'s bin/create, using the version that
is specified in platforms manifest', function() {
                 cordova.platform('add', 'android');
-                expect(exec.mostRecentCall.args[0]).toMatch(/lib.android.cordova.......bin.create/gi);
+                expect(exec.mostRecentCall.args[0]).toMatch(/lib.android.cordova.2.8.1.bin.create/gi);
+                expect(exec.mostRecentCall.args[0]).toContain(project_dir);
+                cordova.platform('add', 'wp8');
+                expect(exec.mostRecentCall.args[0]).toMatch(/lib.wp8.cordova.2.8.0.bin.create/gi);
                 expect(exec.mostRecentCall.args[0]).toContain(project_dir);
             });
             it('should support using custom versions of libraries by calling into lazy_load.custom',
function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/create.js
----------------------------------------------------------------------
diff --git a/src/create.js b/src/create.js
index 5625d77..4dbca3a 100644
--- a/src/create.js
+++ b/src/create.js
@@ -19,6 +19,7 @@
 var path          = require('path'),
     fs            = require('fs'),
     shell         = require('shelljs'),
+    platforms     = require('../platforms'),
     help          = require('./help'),
     events        = require('./events'),
     config        = require('./config'),
@@ -148,7 +149,7 @@ module.exports = function create (dir, id, name, callback) {
                 else throw err;
             } else {
                 events.emit('log', 'Copying stock Cordova www assets into "' + www_dir +
'"');
-                finalize(path.join(util.libDirectory, 'www', 'cordova', util.cordovaTag));
+                finalize(path.join(util.libDirectory, 'www', 'cordova', platforms.www.version));
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/lazy_load.js
----------------------------------------------------------------------
diff --git a/src/lazy_load.js b/src/lazy_load.js
index c90b0aa..6ffcb29 100644
--- a/src/lazy_load.js
+++ b/src/lazy_load.js
@@ -36,8 +36,8 @@ module.exports = {
             else throw err;
         }
 
-        var url = platforms[platform].url + ';a=snapshot;h=' + util.cordovaTag + ';sf=tgz';
-        module.exports.custom(url, 'cordova', platform, util.cordovaTag, function(err) {
+        var url = platforms[platform].url + ';a=snapshot;h=' + platforms[platform].version
+ ';sf=tgz';
+        module.exports.custom(url, 'cordova', platform, platforms[platform].version, function(err)
{
             if (err) {
                 if (callback) return callback(err);
                 else throw err;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/android_parser.js b/src/metadata/android_parser.js
index 8fcd574..b35b80d 100644
--- a/src/metadata/android_parser.js
+++ b/src/metadata/android_parser.js
@@ -57,7 +57,7 @@ module.exports.check_requirements = function(project_root, callback) {
                 if (custom_path) {
                     framework_path = path.resolve(path.join(custom_path, 'framework'));
                 } else {
-                    framework_path = path.join(util.libDirectory, 'android', 'cordova', util.cordovaTag,
'framework');
+                    framework_path = path.join(util.libDirectory, 'android', 'cordova', require('../../platforms').android.version,
'framework');
                 }
                 var cmd = 'android update project -p "' + framework_path  + '" -t android-17';
                 events.emit('log', 'Running "' + cmd + '" (output to follow)...');
@@ -174,7 +174,7 @@ module.exports.prototype = {
         if (custom_path) {
             jsPath = path.resolve(path.join(custom_path, 'framework', 'assets', 'www', 'cordova.js'));
         } else {
-            jsPath = path.join(util.libDirectory, 'android', 'cordova', util.cordovaTag,
'framework', 'assets', 'www', 'cordova.js');
+            jsPath = path.join(util.libDirectory, 'android', 'cordova', require('../../platforms').android.version,
'framework', 'assets', 'www', 'cordova.js');
         }
         fs.writeFileSync(path.join(this.www_dir(), 'cordova.js'), fs.readFileSync(jsPath,
'utf-8'), 'utf-8');
     },

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/metadata/blackberry_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/blackberry_parser.js b/src/metadata/blackberry_parser.js
index b348d9e..3a80f32 100644
--- a/src/metadata/blackberry_parser.js
+++ b/src/metadata/blackberry_parser.js
@@ -123,7 +123,7 @@ module.exports.prototype = {
         shell.cp('-rf', www, this.path);
 
         var custom_path = config.has_custom_path(projectRoot, 'blackberry');
-        var lib_path = path.join(util.libDirectory, 'blackberry', 'cordova', util.cordovaTag);
+        var lib_path = path.join(util.libDirectory, 'blackberry', 'cordova', require('../../platforms').blackberry.version);
         if (custom_path) lib_path = custom_path;
         // add cordova.js
         shell.cp('-f', path.join(lib_path, 'javascript', 'cordova.blackberry10.js'), path.join(this.www_dir(),
'cordova.js'));

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index bcf7718..2853b98 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -179,7 +179,7 @@ module.exports.prototype = {
 
         // write out proper cordova.js
         var custom_path = config.has_custom_path(projectRoot, 'ios');
-        var lib_path = path.join(util.libDirectory, 'ios', 'cordova', util.cordovaTag);
+        var lib_path = path.join(util.libDirectory, 'ios', 'cordova', require('../../platforms').ios.version);
         if (custom_path) lib_path = custom_path;
         shell.cp('-f', path.join(lib_path, 'CordovaLib', 'cordova.js'), path.join(project_www,
'cordova.js'));
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/metadata/wp7_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp7_parser.js b/src/metadata/wp7_parser.js
index f786025..686689a 100644
--- a/src/metadata/wp7_parser.js
+++ b/src/metadata/wp7_parser.js
@@ -42,7 +42,7 @@ module.exports = function wp7_parser(project) {
 
 module.exports.check_requirements = function(project_root, callback) {
     events.emit('log', 'Checking WP7 requirements...');
-    var lib_path = path.join(util.libDirectory, 'wp7', 'cordova', util.cordovaTag);
+    var lib_path = path.join(util.libDirectory, 'wp7', 'cordova', require('../../platforms').wp7.version);
     var custom_path = config.has_custom_path(project_root, 'wp7');
     if (custom_path) lib_path = custom_path;
     var command = '"' + path.join(lib_path, 'bin', 'check_reqs') + '"';
@@ -148,7 +148,7 @@ module.exports.prototype = {
         shell.cp('-rf', project_www, this.wp7_proj_dir);
 
         // copy over wp7 lib's cordova.js
-        var lib_path = path.join(util.libDirectory, 'wp7', 'cordova', util.cordovaTag);
+        var lib_path = path.join(util.libDirectory, 'wp7', 'cordova', require('../../platforms').wp7.version);
         var custom_path = config.has_custom_path(project_root, 'wp7');
         if (custom_path) lib_path = custom_path;
         var cordovajs_path = path.join(lib_path, 'templates', 'standalone', 'www', 'cordova.js');

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/metadata/wp8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp8_parser.js b/src/metadata/wp8_parser.js
index ee7bcd0..2629f5c 100644
--- a/src/metadata/wp8_parser.js
+++ b/src/metadata/wp8_parser.js
@@ -42,7 +42,7 @@ module.exports = function wp8_parser(project) {
 module.exports.check_requirements = function(project_root, callback) {
     events.emit('log', 'Checking WP8 requirements...');
     var custom_path = config.has_custom_path(project_root, 'wp8');
-    var lib_path = path.join(util.libDirectory, 'wp8', 'cordova', util.cordovaTag);
+    var lib_path = path.join(util.libDirectory, 'wp8', 'cordova', require('../../platforms').wp8.version);
     if (custom_path) lib_path = custom_path;
 
     var command = '"' + path.join(lib_path, 'bin', 'check_reqs') + '"';
@@ -148,7 +148,7 @@ module.exports.prototype = {
         shell.cp('-rf', project_www, this.wp8_proj_dir);
 
         var custom_path = config.has_custom_path(projectRoot, 'wp8');
-        var lib_path = path.join(util.libDirectory, 'wp8', 'cordova', util.cordovaTag);
+        var lib_path = path.join(util.libDirectory, 'wp8', 'cordova', require('../../platforms').wp8.version);
         if (custom_path) lib_path = custom_path;
         // copy over wp8 lib's cordova.js
         var cordovajs_path = path.join(lib_path, 'templates', 'standalone', 'www', 'cordova.js');

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/platform.js
----------------------------------------------------------------------
diff --git a/src/platform.js b/src/platform.js
index 1149f23..703f744 100644
--- a/src/platform.js
+++ b/src/platform.js
@@ -120,7 +120,7 @@ module.exports = function platform(command, targets, callback) {
                                     if (callback) callback(err);
                                     else throw err;
                                 } else {
-                                    call_into_create(t, projectRoot, cfg, 'cordova', cordova_util.cordovaTag,
callback, end);
+                                    call_into_create(t, projectRoot, cfg, 'cordova', platforms[t].version,
callback, end);
                                 }
                             });
                         }

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b09847a8/src/util.js
----------------------------------------------------------------------
diff --git a/src/util.js b/src/util.js
index 47fcbed..e0ae3f8 100644
--- a/src/util.js
+++ b/src/util.js
@@ -27,11 +27,8 @@ var HOME = process.env[(process.platform == 'win32') ? 'USERPROFILE' :
'HOME'];
 var global_config_path = path.join(HOME, '.cordova');
 var lib_path = path.join(global_config_path, 'lib');
 shell.mkdir('-p', lib_path);
-// What tag of the cordova libs should be dl'ed
-var TAG = '2.8.0';
 
 module.exports = {
-    cordovaTag:TAG,
     globalConfig:global_config_path,
     libDirectory:lib_path,
     // Runs up the directory chain looking for a .cordova directory.


Mime
View raw message