You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2015/03/05 01:37:36 UTC
[7/8] cordova-lib git commit: CB-8551 updated version of registry
mapper and cordova plugin rm code
CB-8551 updated version of registry mapper and cordova plugin rm code
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/037246ea
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/037246ea
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/037246ea
Branch: refs/heads/CB-8551
Commit: 037246eab72b158dff182d83f1b391b3d451913a
Parents: 862c2a6
Author: Steve Gill <st...@gmail.com>
Authored: Wed Mar 4 16:06:46 2015 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Wed Mar 4 16:06:46 2015 -0800
----------------------------------------------------------------------
cordova-lib/package.json | 2 +-
cordova-lib/src/cordova/plugin.js | 19 +++++++------------
cordova-lib/src/plugman/registry/registry.js | 2 +-
3 files changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/037246ea/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index b7eb682..3aba3db 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -19,7 +19,7 @@
"dependencies": {
"bplist-parser": "0.0.6",
"cordova-js": "3.8.0",
- "cordova-registry-mapper": "0.0.2",
+ "cordova-registry-mapper": "0.0.3",
"d8": "0.4.4",
"dep-graph": "1.1.0",
"elementtree": "0.1.5",
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/037246ea/cordova-lib/src/cordova/plugin.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/plugin.js b/cordova-lib/src/cordova/plugin.js
index 46c4184..497722f 100644
--- a/cordova-lib/src/cordova/plugin.js
+++ b/cordova-lib/src/cordova/plugin.js
@@ -28,7 +28,7 @@ var cordova_util = require('./util'),
shell = require('shelljs'),
PluginInfoProvider = require('../PluginInfoProvider'),
plugman = require('../plugman/plugman'),
- pluginMapper = require('cordova-registry-mapper'),
+ pluginMapper = require('cordova-registry-mapper').newToOld,
events = require('../events');
// Returns a promise.
@@ -240,17 +240,12 @@ module.exports = function plugin(command, targets, opts) {
// Check if we have the plugin.
if (plugins.indexOf(target) < 0) {
// Convert target from package-name to package-id if necessary
- var keys = Object.keys(pluginMapper);
- //Traverse through pluginMapper values to see if it equals our target.
- //Cordova-plugin-device would get changes to org.apache.cordova.device
- for (var i = 0; i < keys.length; i++) {
- var val = pluginMapper[keys[i]];
- if(val === target) {
- events.emit('log', 'Plugin "' + target + '" is not present in the project. Converting value to "' + keys[i] + '" and trying again.');
- target = keys[i];
- }
- }
-
+ // Cordova-plugin-device would get changed to org.apache.cordova.device
+ var pluginId = pluginMapper[target];
+ if(pluginId) {
+ events.emit('log', 'Plugin "' + target + '" is not present in the project. Converting value to "' + pluginId + '" and trying again.');
+ target = pluginId;
+ }
if (plugins.indexOf(target) < 0) {
return Q.reject(new CordovaError('Plugin "' + target + '" is not present in the project. See `'+cordova_util.binname+' plugin list`.'));
}
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/037246ea/cordova-lib/src/plugman/registry/registry.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/registry/registry.js b/cordova-lib/src/plugman/registry/registry.js
index 7c5a7ba..079c5a0 100644
--- a/cordova-lib/src/plugman/registry/registry.js
+++ b/cordova-lib/src/plugman/registry/registry.js
@@ -27,7 +27,7 @@ var npm = require('npm'),
rc = require('rc'),
Q = require('q'),
request = require('request'),
- pluginMapper = require('cordova-registry-mapper'),
+ pluginMapper = require('cordova-registry-mapper').oldToNew,
home = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,
events = require('../../events'),
unpack = require('../../util/unpack'),
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org