2

I have a game project, with several images. Sometimes I need to perform a clean, because some images are not updated for some reason.

The project is huge and it takes a fair amount of time to build after the clean. If I know the culprit files, is there a way to clean only those specific files, instead of the entire project?

Saturn
  • 17,888
  • 49
  • 145
  • 271

1 Answers1

3

Since you know it's the images folder that is the most problematic, perhaps you should add a "Run Script" Build Phase in your build process to erase your images folder from your build destination, so the "Copy Bundle Resources" build phase that comes later in your build process will always successfully copy the most up-to-date image files.

To add the Run Script build phase, you can do something like this in Xcode 5:

Run Script Build Phase

And then in that phase (which you need to move to close to the beginning of the build process), you'll create a tiny script that removes the image folder.

My initial guess is that you could potentially start with using the Xcode environment variable "CODESIGNING_FOLDER_PATH" (which may only point to the "Release" builds), but if you look at this related question you may figure out how to come up with the correct environment variables and script to use. It might be a combination of something like "CONFIGURATION_BUILD_DIR" + "PRODUCT_NAME" + ".app/Contents/Resources/MyImageFolder" into a shell variable.

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215