Xcode running “run script” phase when target sources remain unchanged.

During "run script" phase of one of my build targets in Xcode, I read the file content of some previous dependant targets build results.

However, If I re-compile the project after deliberately modifying my target dependents, It appears that "run script" reads the older version of the file (when I read it from bash, I get the new result.) .. To overcome this problem I can modify one of target's sources or cleaning and compiling from scratch, but I wonder if there's any cache that stores data from "run script" phase that may cause this issue, and how it's possible to remove it.


Notice that the problem occurs only if all the "compile sources" of the target with the "run script" remain untouched, although I explicitly states the other dependent targets under "Target Dependency" section.


In short, I'd like to enforce running "run script" phase, even if target sources remained unchanged, because the result of this script may product an header file that requires re-compilation.


Replies

Do you do a Clean Build Folder (option clean in Project menu) before re-compile ? That cleans the obsolete dependencies.

Hi and thanks for your reply.


The compile-after-clean option is working just fine. However, i wish to avoid cleaning the entire project (with all targets) every time so that the "run script" will take action.


I know that if I change one of the compile sources, target will be rebuilt including the run script phase.


However, in my particular scenario, the dependency is another target in the same project. I wish I could mark that when the dependent target gets compiled, my main target (with the run script phase) will also gets compiled as well right after.