Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove headers from my custom frameworks?

I have a Mac Cocoa application that uses several custom frameworks. (Apple calls them private, it’s the frameworks that get distributed in the app bundle with your application.) Inside each framework there is a Headers folder with the framework’s header files. These are not needed inside the resulting application bundle & I’d like to keep them private. Currently I use a Run Script build phase with the following line:

# Remove all headers from our private frameworks
find "${TARGET_BUILD_DIR}" -name Headers -print0 | xargs -0 rm -rf

Is this the way to do it, or is there a better one?


More about my project structure: I have three Xcode projects nested in my main project, these projects have my private frameworks as their products. The frameworks are set up as a target dependency for my main target. And the last part of the setup is a Copy Files build phase that takes the frameworks and copies them into a Frameworks subfolder inside the application bundle. (Hope this is clear enough.)

like image 805
zoul Avatar asked Nov 05 '22 22:11

zoul


1 Answers

you probably have a copy headers build phase in place for your framework. you can:

1) remove it,

2) individually specify the headers' visibility in the ide,

3) or add/remove them from the copy headers phase

i just set my targets up as build dependencies, with:

  • custom search paths for headers
  • a copy phase for the fmwk
  • no copy headers phase

you may choose to do it differently (e.g. only build the fmwk explicitly, or export some headers).

if you (eventually) don't get a satisfactory answer, some more details about your projects' structures may help, because there are a number of ways to configure this.

good luck

like image 159
justin Avatar answered Nov 09 '22 10:11

justin