cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] stevengill closed pull request #43: CB-13424: "cordova plugin add/remove" writes changes in config.xml
Date Thu, 01 Jan 1970 00:00:00 GMT
stevengill closed pull request #43: CB-13424: "cordova plugin add/remove" writes changes in
config.xml
URL: https://github.com/apache/cordova-osx/pull/43
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bin/templates/scripts/cordova/Api.js b/bin/templates/scripts/cordova/Api.js
index 8867e38..0cc666d 100644
--- a/bin/templates/scripts/cordova/Api.js
+++ b/bin/templates/scripts/cordova/Api.js
@@ -20,7 +20,9 @@
 var fs = require('fs');
 var path = require('path');
 
-var CordovaError = require('cordova-common').CordovaError;
+var PluginManager = require('cordova-common').PluginManager;
+var projectFile   = require('./lib/projectFile');
+var CordovaError  = require('cordova-common').CordovaError;
 var ConsoleLogger = require('./lib/ConsoleLogger');
 
 /**
@@ -181,8 +183,8 @@ Api.prototype.prepare = function (cordovaProject) {
  *   CordovaError instance.
  */
 Api.prototype.addPlugin = function (plugin, installOptions) {
-    var Plugman = require('./lib/plugman/Plugman');
-    return Plugman.get(this.locations, this.events).addPlugin(plugin, installOptions);
+    var xcodeproj = projectFile.parse(this.locations);
+    return PluginManager.get(this.platform, this.locations, xcodeproj).addPlugin(plugin,
installOptions);
 };
 
 /**
@@ -199,8 +201,8 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
  *   CordovaError instance.
  */
 Api.prototype.removePlugin = function (plugin, uninstallOptions) {
-    var Plugman = require('./lib/plugman/Plugman');
-    return Plugman.get(this.locations, this.events).removePlugin(plugin, uninstallOptions);
+    var xcodeproj = projectFile.parse(this.locations);
+    return PluginManager.get(this.platform, this.locations, xcodeproj).removePlugin(plugin,
uninstallOptions)
 };
 
 /**
diff --git a/bin/templates/scripts/cordova/lib/projectFile.js b/bin/templates/scripts/cordova/lib/projectFile.js
index 0d0057b..b373464 100644
--- a/bin/templates/scripts/cordova/lib/projectFile.js
+++ b/bin/templates/scripts/cordova/lib/projectFile.js
@@ -26,6 +26,7 @@ var path = require('path');
 var fs = require('fs');
 var shell = require('shelljs');
 
+var pluginHandlers = require('./plugman/pluginHandlers');
 var CordovaError = require('cordova-common').CordovaError;
 
 var cachedProjectFiles = {};
@@ -81,6 +82,12 @@ function parseProjectFile (locations) {
         getPackageName: function () {
             return plist.parse(fs.readFileSync(plist_file, 'utf8')).CFBundleIdentifier;
         },
+        getInstaller: function (name) {
+            return pluginHandlers.getInstaller(name);
+        },
+        getUninstaller: function (name) {
+            return pluginHandlers.getUninstaller(name);
+        },
         frameworks: frameworks
     };
     return cachedProjectFiles[project_dir];
diff --git a/package.json b/package.json
index dcac015..0e2dd06 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
   "author": "Apache Software Foundation",
   "license": "Apache Version 2.0",
   "dependencies": {
-    "cordova-common": "^1.0.0",
+    "cordova-common": "2.1.0",
     "nopt": "^3.0.6",
     "q": "^1.4.1",
     "shelljs": "^0.5.3",


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message