I've fought against Xcode with regards to this before, where I want to add a list of files and directories to be copied into the built app-package, and XCode only wants to let me add entire folders. Now I need a proper solution...
I have a workspace with multiple targets, one per application. I have a directory structure with lots of assets/data files structured a bit like this:
- Data
|- Common
| |-Scripts
| |-Images
|- AppA
| |-Scripts
| |-Images
|- AppB
| |-Scripts
| |-Images
I want to add Data/Common/* to my targets AppA & AppB, and then Data/AppA/* to AppA, etc.
What I find is if I add a folder reference to Data to my XCode project, I cannot select workspaces - I only can set which targets Data is associated with.
I could add folder references to each subfolder individually but then I think this would break the directory structure I want to achieve. Also, it just seems to get messy... say I don't want all of Common in both apps, but to cherry-pick certain sub-dirs/files for each app?
So, is there a more arbitrary way in XCode[4] to tell it which files go where? I'm aware I can write a custom bash-script build phase, I used to do that in fact but it was really bad for build performance.
Option 1) Create a bash installer and hardcode the paths inside the main project:
Option 2) Use pkgbuild, productbuild and pkgutil like so:
Making OS X Installer Packages like a Pro - Xcode Developer ID ready pkg