You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/08/17 16:42:56 UTC

[GitHub] dpogue commented on a change in pull request #395: Implement swift support and testing

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:
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