Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for the addition of Embedded Binaries #78

Open
Compulsed opened this issue Feb 23, 2016 · 7 comments
Open

Support for the addition of Embedded Binaries #78

Compulsed opened this issue Feb 23, 2016 · 7 comments

Comments

@Compulsed
Copy link

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!

image

@aabluedragon
Copy link
Contributor

+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).

@aabluedragon
Copy link
Contributor

aabluedragon commented Apr 19, 2016

For the time being, here's a workaround I implemented:
http://stackoverflow.com/a/36723619/230637

@jainpiyushb
Copy link

@aabluedragon isn't your workaround for Embedded Framework and not Embedded binary?

@aabluedragon
Copy link
Contributor

aabluedragon commented Feb 7, 2017

@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).

@shazron
Copy link
Contributor

shazron commented Apr 1, 2017

Hi @aabluedragon ,
I thought it's supported here:

pbxProject.prototype.addFramework = function(fpath, opt) {
already (embed option)? But I can't get it to work by implementing apache/cordova-ios#299

@shazron
Copy link
Contributor

shazron commented Apr 4, 2017

Debugged this. The embed option will only add the framework if the "Copy Files" phase (that has to be named "Embed Frameworks") exists.

@shazron
Copy link
Contributor

shazron commented Apr 11, 2017

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants