[ 
https://issues.apache.org/jira/browse/CB-13424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16238677#comment-16238677
 ] 

ASF GitHub Bot commented on CB-13424:
-------------------------------------

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:
[email protected]


> [cordova-osx] Not adding plugins to the osx platform
> ----------------------------------------------------
>
>                 Key: CB-13424
>                 URL: https://issues.apache.org/jira/browse/CB-13424
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-osx
>            Reporter: José Expósito
>            Assignee: Tobias Bocanegra
>            Priority: Blocker
>
> cordova plugin add does not work on macOS.
> It is necessary to open "platforms/osx/HelloCordova.xcodeproj" and manually 
> add the plugin to "platforms/osx/HelloCordova/config.xml":
> {code}
> <?xml version='1.0' encoding='utf-8'?>
> <widget id="io.cordova.hellocordova" version="1.0.0" 
> xmlns="http://www.w3.org/ns/widgets"; 
> xmlns:cdv="http://cordova.apache.org/ns/1.0";>
>     [...]
>     <feature name="Device">
>         <param name="osx-package" value="CDVDevice" />
>     </feature>
>     [...]
> </widget>
> {code}
> I noticed this happens with Cordova core plugins with official macOS support 
> like cordova-plugin-device or cordova-plugin-file.
> Also experimented while migrating cordova-plugin-camera:
> https://github.com/apache/cordova-plugin-camera/pull/290



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to