Xcode - build phase or script for copying only modified files to App Bundle

旧街凉风 提交于 2019-12-08 05:44:19

问题


Mac OS X 10.5 compatibility required. Xcode 3.2.5.

My app looks in the bundle's Resources folder, for a "data" folder.

"data" contains a hierarchy of subfolders and data. The contents are constantly being modified.

I don't need to navigate or modify this data within Xcode.

Q. When building, how can I copy "data" (say, from the Xcode project's folder) to the Resources folder, but only copying those files within "data" that have been modified since the last build?

(Simply copying all files every time I build is not feasible; the file sizes are too large, slowing build times.)

Thanks for any help.


回答1:


Shouldn't be a problem to use rsync in a shell script build phase. Something like this:

rsync -a "${SRCROOT}/data" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"

That does a bit more than date comparison but it should still be quite a bit faster than what you're doing now.

The above doesn't delete any files you removed from the source directory; to do so, you can add --delete but I'd only suggest doing that after you're sure it's working properly.



来源:https://stackoverflow.com/questions/4252239/xcode-build-phase-or-script-for-copying-only-modified-files-to-app-bundle

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