dpogue commented on a change in pull request #395: Implement swift support and testing URL: https://github.com/apache/cordova-ios/pull/395#discussion_r210967320
########## File path: bin/templates/scripts/cordova/Api.js ########## @@ -233,6 +233,27 @@ Api.prototype.addPlugin = function (plugin, installOptions) { return PluginManager.get(self.platform, self.locations, xcodeproj) .addPlugin(plugin, installOptions) + .then(function () { + if (plugin != null) { + var headerTags = plugin.getHeaderFiles(self.platform); + var bridgingHeaders = headerTags.filter(function (obj) { + return (obj.type === 'BridgingHeader'); + }); + if (bridgingHeaders.length > 0) { + var project_dir = self.locations.root; + var project_name = self.locations.xcodeCordovaProj.split('/').pop(); + var BridgingHeader = require('./lib/BridgingHeader').BridgingHeader; + var bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h')); + events.emit('verbose', 'Adding Bridging-Headers since the plugin contained <header-file> with type="BridgingHeader"'); + bridgingHeaders.forEach(function (obj) { + var bridgingHeaderPath = path.basename(obj.src); + bridgingHeaderFile.addHeader(plugin.id, bridgingHeaderPath); + }); + bridgingHeaderFile.write(); + } + } + return Q.resolve(); Review comment: Do we need to return `Q.resolve()` here? I think if the function finishes with no exceptions, it should continue into the next `.then` block ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org