Github user shazron commented on a diff in the pull request: https://github.com/apache/cordova-ios/pull/234#discussion_r69505429 --- Diff: bin/templates/scripts/cordova/Api.js --- @@ -236,10 +317,50 @@ Api.prototype.addPlugin = function (plugin, installOptions) { * CordovaError instance. */ Api.prototype.removePlugin = function (plugin, uninstallOptions) { - var xcodeproj = projectFile.parse(this.locations); return PluginManager.get(this.platform, this.locations, xcodeproj) .removePlugin(plugin, uninstallOptions) + .then(function() { + if (plugin.getFrameworks(this.platform).length === 0) return; + console.log('Looking into removing pods since the plugin contained <framework>'); + //require script to run pod remove + //pods.json might not exist (if not pods were removed). + //the pod will already be removed from pods.json at this stage + //need to check podfile and see if a pod exists in podfile that doesn't exist in pods.json. If so, remove it. + + // which pods are in the plugin? + var frameworkTags = plugin.getFrameworks(this.platform); + var project_dir = this.locations.root; + var pods_file = path.join(project_dir, 'pods.json'); + var array_of_pod_objects = []; + + delete require.cache[require.resolve(pods_file)]; + var pods = require(pods_file); + + // check if any of the framework tags are of type "podspec" + frameworkTags.forEach(function (obj) { + if (obj.type == 'podspec') { + array_of_pod_objects.push(obj); + } + }); + + var podMod = require('./lib/podMod'); + + array_of_pod_objects.forEach(function (obj) { + // according to pods.json, does more than one plugin depend on the pod? + if (pods[obj.src].count > 1) { --- End diff -- Inconsistent logic from your other code: https://github.com/apache/cordova-ios/pull/234/commits/e95fd6f393b7888b8d739dfbe8bd84805e30c67e#diff-4dd01b7c4b3f825b9b9e6f223a83ec71R104
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org