Open Compulsed opened 8 years ago
+1 Coming from the Cordova Plugins world, I need this as well in my custom plugin, would be nice if it was supported (and with an option in plugin.xml).
For the time being, here's a workaround I implemented: http://stackoverflow.com/a/36723619/230637
@aabluedragon isn't your workaround for Embedded Framework and not Embedded binary?
@jainpiyushb It is, however the Xcode section refers to it by the name "Embedded Binaries" (and The framework contains the binary itself) also note that the headers are removed upon build (as opposed to the binary).
Hi @aabluedragon , I thought it's supported here: https://github.com/alunny/node-xcode/blob/078625f16c102372965cc5a4f6a8f7a5145d36aa/lib/pbxProject.js#L300 already (embed option)? But I can't get it to work by implementing https://github.com/apache/cordova-ios/pull/299
Debugged this. The embed option will only add the framework if the "Copy Files" phase (that has to be named "Embed Frameworks") exists.
I believe this feature is already implemented. Here's some code that should work:
let embed = true,
link = false,
frameworkPath = '/Users/me/Desktop/MyFramework.framework',
project; // the node-xcode pbxProject reference
let existsEmbedFrameworks = project.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks');
if (!existsEmbedFrameworks && embed) {
console.log('"Embed Frameworks" Build Phase (Embedded Binaries) does not exist, creating it.');
project.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Embed Frameworks', null, 'frameworks');
}
let options = { customFramework: true, embed: embed, link: link, sign: true };
project.addFramework(frameworkPath, opt);
I need to be able to programmatically add embedded binaries (Cordova & a 3rd party dynamic framework being used), but I cannot see how I am able to do this using this XCode node module.
Is there plans on having this supported sometime in the future? Is this already supported and I am missing something?
Thanks!