I've been trying to add a Copy Files build phase to a project template for Xcode 4 but I cannot figure out how to add files to copy.
Here's what I've added to my target. Changes to DstPath, DstSubfolderSpec and RunOnlyForDeploymentPostprocessing are all reflected in projects created from the template. But no files. I have tried adding an array using keys named Files, Definitions, Nodes, nothing has any affect.
Any thoughts or ideas would be greatly appreciated!
<key>BuildPhases</key>
<array>
<dict>
<key>Class</key>
<string>CopyFiles</string>
<key>DstPath</key>
<string></string>
<key>DstSubfolderSpec</key>
<string>10</string>
<key>RunOnlyForDeploymentPostprocessing</key>
<string>NO</string>
</dict>
</array>
I found a little gem hidden in some weird python script that gave a "better" (as opposed to nothing) explanation of the mysterious DstSubfolderSpec
…
# dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase object.
'BUILT_PRODUCTS_DIR': 16, # Products Directory
: 1, # Wrapper
: 6, # Executables: 6
: 7, # Resources
: 15, # Java Resources
: 10, # Frameworks
: 11, # Shared Frameworks
: 12, # Shared Support
: 13, # PlugIns
There's actually quite a bit of interesting info in the script, (apparently it's part of pythonwebkit, or something).. but regardless, I posted a gist of it here if you want to try and glean any other useful tidbits.
So far I have this working:
<dict>
<key>Class</key>
<string>CopyFiles</string>
<key>DstPath</key>
<string>www</string>
<key>DstSubfolderSpec</key>
<string>7</string>
This creates a CopyFiles build phase that copies files to the folder "www" inside of Resources. (This would result in those files living under /www in the app bundle.) However, I haven't yet been able to specify which files get copied. This is similar to this question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With