Xcode - 构建阶段或脚本,仅将已修改的文件复制到App Bundle [英] Xcode - build phase or script for copying only modified files to App Bundle
问题描述
需要Mac OS X 10.5兼容性。 Xcode 3.2.5。
Mac OS X 10.5 compatibility required. Xcode 3.2.5.
我的应用程序在包的Resources文件夹中查找data文件夹。
My app looks in the bundle's Resources folder, for a "data" folder.
data包含子文件夹和数据的层次结构。内容不断被修改。
"data" contains a hierarchy of subfolders and data. The contents are constantly being modified.
我不需要在Xcode中导航或修改这些数据。
I don't need to navigate or modify this data within Xcode.
Q。构建时,如何将数据(例如,从Xcode项目的文件夹)复制到Resources文件夹,但是只能复制自上次修改的数据建立?
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.)
感谢任何帮助。
推荐答案
使用 rsync
在shell脚本构建阶段。像这样:
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.
上述操作不会删除您从源目录中删除的任何文件;为此,您可以添加 - delete
,但是我只建议在确定它工作正常后再做。
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.
这篇关于Xcode - 构建阶段或脚本,仅将已修改的文件复制到App Bundle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!