Bundle framework with plug-in in XCode - xcode

there is a post here on how to bundle a framework within an application. But in my case this is not application but a plug-in i want to put the framework within.. The "Installation directory" cannot start with #executable_path. so i have no clue on how to define the plug-in path
any help would be great, thank you

#loader_path/../Frameworks
dylib #executable_path path issue in a plug-in bundle

Typically, this will depend on the application you're writing the plug-in for, and how it implements plug-ins.
You might be able to get away with using relative paths (ie. '../Frameworks') but I suspect only experimentation will show whether or not that works. ;)

Related

Netbeans javafx mac bundle without JRE

I am having a hard time trying to build my javafx app into .app (for mac).
I found a legit way to do that, here is resource for that:
http://docs.oracle.com/javafx/2/deployment/deploy_quick_start.htm
However, it is far from what I'm looking for. By following that tutorial, I managed to build an app from my javafx project, however the size of file was just ridiculous and it is because the whole JRE is being bundled inside. I am now looking for a way to deploy .app file with dependencies (it's important) ONLY and without JRE. (JRE should be pre-installed by user). Is there a way to do that? I really tried to find one, but faild. Hope you, guys, help me.
Instructions for packaging a JavaFX application as a native installable app without including a JRE:
JavaFX packaging tools update - Self-Contained Applications: Create Package without Java Runtime.
The tools used are the same as from the deployment quick start you mention in your question. You just set the fx:platform basedir="".
I'll just quote the article here:
This may sound a bit puzzling at first glance. Package without embedded Java Runtime is not really self-contained and obviously will not help with:
Deployment on fresh systems. JRE need to be installed separately (and this step will require admin permissions).
Possible compatibility issues due to updates of system runtime.
However, these packages are much much smaller in size. If download size matters and you are confident that user have recommended system JRE installed then this may be good option to consider if you want to improve user experience for install and launch.
Technically, this is implemented as an extension of previous feature. Pass empty string as value for 'basedir' attribute and this will be treated as request to not bundle Java runtime, e.g.
<fx:platform basedir=""/>

How can I archive my cocoa framework

Sorry for my poor English first.I have a problem and I googled it and try to solve this problem the whole day.
The problem is I have a cocoa framework project, and It build succeeded and archive succeeded.
BUT when my project using this framework, it will show can't find the framework, image not found.
OK, I know the problem now, so I searched and find out #executable_path and #loader_path, to make the project using this framework will find the path easy.
But when I change install directory in Building Settings from the default value ~/Library/Framework to #executable_path/../Framework, my framework STILL could build success and archive success.But I can't find the archive file and archive window will not show.Xcode tells me below:
Check dependencies
Warning: Installation Directory starts with #executable_path but Skip Install is disabled.
TIPS:
When I set #executable_path, Xcode tells me "The skip install to YES", I can't do that, because when I set to YES, it won't archive for me.
How could I solve this problem? Or anything wrong in my project?
Thanks so much!
My code here https://github.com/GuoJing/DoubanAPICocoa
you need to use loader path to identify the framework path

What is the cleanest way to set the environmental variable DYLD_FRAMEWORK_PATH for a release build?

I have custom frameworks in my app bundle for WebKit, WebCore, and JavaScriptCore. I would like all other frameworks that depend on the system versions of WebKit, WebCore, or JavaScriptCore to use my custom versions also. For instance my custom version of Webkit loads private system frameworks that in turn depend on the system version of WebKit. This means both my WebKit and the system WebKit get loaded, and usually a crash happens shortly after.
The way I understand this should be done, is to set the DYLD_FRAMEWORK_PATH environmental variable before your app bundle begins execution (Search order for loading frameworks can be found here: http://code.google.com/p/macdependency/wiki/SearchPaths). You can set environmental variables in code with setenv, but it won't take effect for the currently running process. I would have to re-launch the process again for it to take effect. I would like to avoid this too.
So my question is what is the best way to set the DYLD_FRAMEWORK_PATH before the execution of the my app bundle? This has to work in a release app bundle too. Is there a way to run a script whenever someone clicks on my app bundle before the executable starts running. Or is there any other suggestions out there?
Thanks in advance.
Jeff Wolski has the right idea by referring directly to Apple's documentation on the subject. This thread also provides excellent advice on how to get that going in Xcode, including corner cases associated with alternative methods of specification (for example, by using ~/.bash_profile directly for your user).
My reason for chiming in is you also asked for a script that might be able to assist you (and a bounty provider appears to have the same issue). It turns out Webkit references such a script in its documentation, which you might want to pick apart from the applicable Webkit source code. This should give you additional guidance on how, at least according to the developers, you should do this properly.
Best of luck with your project(s).
I would recommend environment.plist or the LSEnvironment key in the info.plist. Check out the link below.
https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html
WebKit currently has a script to do this for you, called run-webkit-app. See http://trac.webkit.org/browser/trunk/Tools/Scripts/run-webkit-app
Newer versions of ld understand the -dyld_env flag, which inserts a LC_DYLD_ENVIRONMENT load command into the binary (and as such applies essentially as early as possible in app execution). Perhaps adding -Wl,-dyld_env,DYLD_FRAMEWORK_PATH=/folder/encosing/WebKit/and/related/frameworks to your compiler flags might do what you want?

Problem embedding a custom framework inside an .app bundle with XCode 4

I've been searching the web (and S.O.) for a while before asking this question. But I'm totally stuck and I don't know how to fix this.
I have to embed a custom framework inside an .app bundle, using XCode 4. I know I have to fix the install path of the framework using the install_name_tool utility. I've done it like this:
install_name_tool -change /Library/Frameworks/Ogg.framework/Versions/A/Ogg #executable_path/../Frameworks/Ogg.framework/Versions/A/Ogg <input framework>
I've verified that the framework was actually processed by looking at the "last modified" timestamp of the file.
Now the problem: the framework gets copied into the app bundle, but when I run the application, it crashes and in the error report it tells that /Library/Frameworks/Ogg.framework/Versions/A/Ogg image could not be found. Please note the wrong name.
I'm sure I'm embedding the right version of the framework (the one modified by install_name_tool).
What can I do? Thank you in advance.
EDIT: I even tried recompiling the library from sources, specifiying a different install path, but the problem persists. I've tried otool -L on the executable of my application, and it lists the Ogg framework with the wrong path (/Library/Frameworks/....). I don't know where it takes it. Please help...
You want to run install_name_tool on the application's binary.
Or you can change the install name of the framework to #executable_path/../<blah blah> before you link the application to it.

Adding a Library to your build and link path in XCode

I am tryingo to build a GUI application using the JUCE framework on MAC OSX.
I have dowloaded all the API's and got a small hello World program running fine.
However, when I add files to my Xcode project I get compilation errors that say that the Juce library files don`t exist. I would like to know how to get the library API in the build and link path in XCode so that it finds the neccesary files for compilation.
What I would do on Visual Studio going to properties and adding aditional library dependencies, is what I need to do in XCode but I don't know how.
Any help greatly appreciated.
thanks.
Old question but maybe a useful answer in the future....
If you have the "Hello World" up and runnning, it should already be linked to the library. Are you using the introjucer? This should help get everything up and running for you. If you are, you need to add classes etc to the introjucer, as this sets up Xcode / VStudio for you. If not, (Presuming XCode 3 as you are using leopard) goto Xcode > Preferences. Scroll along to source trees, and add the path to the juce folder in there.

Resources