How can I preserve subgroups when changing role to public in Copy Headers build phase in XCode?

*爱你&永不变心* 提交于 2019-12-06 08:19:17

问题


currently, the hierarchy is flattened out, and all the headers files are copied into a single Headers directory, no matter what subfolder they were in, in my Classes folder.

This is a problem when referencing the headers, if the headers have "include" statements that reference other headers in subfolders.

in particular, this screws up BridgeSupport compilation.


回答1:


My understanding is the Copy Headers behavior always flattens the file structure. You can either add a custom file copy or a custom script at the end of the process that copies (cp -r) the headers from their original location to your desired destination. These are viable workarounds for now. Meanwhile, definitely post your request to bugreport.apple.com.




回答2:


Add source folder as reference to folder (radio button in the "Add files..." dialog). Then drag'n'drop those folders to "Build Phases->Copy Files". After this headers will be located in folders on next build.




回答3:


From http://lists.apple.com/archives/xcode-users/2007/Oct/msg00162.html

"Try adding the folder containing the header to Xcode as a folder reference, and then add that to the Copy Headers build phase (you'll probably have to drag-drop it into the phase rather than checking the checkbox in the detail view). Folder references are the mechanism Xcode provides for preserving a directory hierarchy during a copy."



来源:https://stackoverflow.com/questions/5071425/how-can-i-preserve-subgroups-when-changing-role-to-public-in-copy-headers-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!