You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/05/17 18:46:48 UTC

[1/3] git commit: Fix plugin installation and removal with new ID-based directories

Updated Branches:
  refs/heads/future c2488806a -> cead6ca01


Fix plugin installation and removal with new ID-based directories


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

Branch: refs/heads/future
Commit: f19326a66fbc841cf61e116518726fc10046f6cc
Parents: 975ddb2
Author: Braden Shepherdson <br...@gmail.com>
Authored: Mon May 13 17:25:30 2013 -0400
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Mon May 13 17:25:30 2013 -0400

----------------------------------------------------------------------
 src/plugin.js |   49 +++++++++++++++++++++++--------------------------
 1 files changed, 23 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f19326a6/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index 355157d..f560ade 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -50,19 +50,12 @@ module.exports = function plugin(command, targets, callback) {
     var platforms = cordova_util.listPlatforms(projectRoot);
 
     // Massage plugin name(s) / path(s)
-    var pluginPath, plugins, names = [];
+    var pluginPath, plugins;
     pluginPath = path.join(projectRoot, 'plugins');
     plugins = ls(pluginPath);
-    if (targets) {
-        if (!(targets instanceof Array)) targets = [targets];
-        targets.forEach(function(target) {
-            if (target[target.length - 1] == path.sep) {
-                target = target.substring(0, target.length - 1);
-            }
 
-            var targetName = target.substr(target.lastIndexOf(path.sep) + 1);
-            names.push(targetName);
-        });
+    if (targets && !(targets instanceof Array)) {
+        targets = [targets];
     }
 
     switch(command) {
@@ -85,17 +78,22 @@ module.exports = function plugin(command, targets, callback) {
                 }
 
                 // Fetch the plugin first.
-                plugman.fetch(target, pluginsDir, false);
-                
-                // Iterate over all platforms in the project and install the plugin.
-                platforms.forEach(function(platform) {
-                    var platformRoot = path.join(projectRoot, 'platforms', platform);
-                    var parser = new parsers[platform](platformRoot);
-                    plugman.install(platform, platformRoot,
-                                    names[index], pluginsDir, {}, parser.staging_dir());
-                });
+                plugman.fetch(target, pluginsDir, false /* no link */, undefined /* subdir */, function(err, dir) {
+
+                    if (err) {
+                        throw new Error('Error fetching plugin: ' + err);
+                    }
+
+                    // Iterate over all platforms in the project and install the plugin.
+                    platforms.forEach(function(platform) {
+                        var platformRoot = path.join(projectRoot, 'platforms', platform);
+                        var parser = new parsers[platform](platformRoot);
+                        plugman.install(platform, platformRoot,
+                                        path.basename(dir), pluginsDir, {}, parser.staging_dir());
+                    });
 
-                hooks.fire('after_plugin_add');
+                    hooks.fire('after_plugin_add');
+                });
             });
             if (callback) callback();
             break;
@@ -105,10 +103,9 @@ module.exports = function plugin(command, targets, callback) {
                 throw new Error('You need at least one platform added to your app. Use `cordova platform add <platform>`.');
             }
             targets.forEach(function(target, index) {
-                var targetName = names[index];
                 // Check if we have the plugin.
-                if (plugins.indexOf(targetName) > -1) {
-                    var targetPath = path.join(pluginPath, targetName);
+                if (plugins.indexOf(target) > -1) {
+                    var targetPath = path.join(pluginPath, target);
                     hooks.fire('before_plugin_rm');
                     // Check if there is at least one match between plugin
                     // supported platforms and app platforms
@@ -125,15 +122,15 @@ module.exports = function plugin(command, targets, callback) {
                     intersection.forEach(function(platform) {
                         var platformRoot = path.join(projectRoot, 'platforms', platform);
                         var parser = new parsers[platform](platformRoot);
-                        plugman.uninstall(platform, platformRoot, targetName, path.join(projectRoot, 'plugins'), {}, parser.staging_dir());
+                        plugman.uninstall(platform, platformRoot, target, path.join(projectRoot, 'plugins'), {}, parser.staging_dir());
                     });
 
                     // Finally remove the plugin dir from plugins/
-                    plugman.remove(targetName, path.join(projectRoot, 'plugins'));
+                    plugman.remove(target, path.join(projectRoot, 'plugins'));
 
                     hooks.fire('after_plugin_rm');
                 } else {
-                    throw new Error('Plugin "' + targetName + '" not added to project.');
+                    throw new Error('Plugin "' + target + '" not added to project.');
                 }
             });
             if (callback) callback();


[2/3] git commit: Add git ref parameter support to CLI.

Posted by br...@apache.org.
Add git ref parameter support to CLI.


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

Branch: refs/heads/future
Commit: 69f0909eddf9a370890033e451ef56bfb5d70708
Parents: f19326a
Author: Braden Shepherdson <br...@gmail.com>
Authored: Fri May 17 12:43:27 2013 -0400
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Fri May 17 12:43:27 2013 -0400

----------------------------------------------------------------------
 src/plugin.js |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/69f0909e/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index f560ade..d05de1f 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -78,8 +78,7 @@ module.exports = function plugin(command, targets, callback) {
                 }
 
                 // Fetch the plugin first.
-                plugman.fetch(target, pluginsDir, false /* no link */, undefined /* subdir */, function(err, dir) {
-
+                plugman.fetch(target, pluginsDir, false /* no link */, undefined /* subdir */, undefined /* git_ref */, function(err, dir) {
                     if (err) {
                         throw new Error('Error fetching plugin: ' + err);
                     }


[3/3] git commit: Merge branch 'future' of https://git-wip-us.apache.org/repos/asf/cordova-cli into future

Posted by br...@apache.org.
Merge branch 'future' of https://git-wip-us.apache.org/repos/asf/cordova-cli into future


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

Branch: refs/heads/future
Commit: cead6ca01ac33410a48c42348d6fa78291b1342e
Parents: 69f0909 c248880
Author: Braden Shepherdson <br...@gmail.com>
Authored: Fri May 17 12:46:33 2013 -0400
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Fri May 17 12:46:33 2013 -0400

----------------------------------------------------------------------
 .../bin/templates/cordova/appinfo.jar              |  Bin 1574 -> 1574 bytes
 src/create.js                                      |    5 ++---
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------