Reputation: 3794
During my build my files arent always copied. Even when i modify them.
Its a web app im building and the folder that isnt copying is: HTML (blue folder icon) it references a HTML folder on disk.
It doesnt seem to copy.
I've tryed doing a run script saying Shell: /bin/sh Script: touch -cm ${SRCROOT}
And it makes no differnece.
How can i FORCE xcode to always copy every file?
E.g a script to touch every file and folder to make sure it copies?
Im a a dead end here!
Upvotes: 0
Views: 777
Reputation: 96323
A blue folder represents a folder reference, which is a kind of file reference, just like all the references to .h and .m files in your project.
The only modification time Xcode cares about is that of the referenced item—in this case, the folder. Not that of any item in the folder, nor of any descendant item, nor of any ancestor folder (such as your project directory, which is what $SRCROOT
refers to).
So, you need to touch the folder specifically. Any time you modify anything in the folder, you need to touch that folder.
This doesn't apply if you add or delete files in the folder, since that counts as modifying the folder itself.
If you really want to unconditionally copy the folder every time, you can create a shell script phase before the Copy Files phase that takes the folder as an input and produces it as an output, and touches that folder specifically. Then the Copy Files phase after it will see that the folder has been “modified” and will re-copy it.
Expect long build times if you do that.
Upvotes: 2