I wrote a pre-commit git hook that aborts the commit if my xcode project fails to compile.
He does this by running xcodebuild with the appropriate settings for my project. If xcodebuild returns a non-zero status, you cannot commit your changes.
Here is the xcodebuild command that I run:
xcodebuild -project MYPROJ/MYPROJ.xcodeproj -target MYPROJ -configuration Debug clean build CODE_SIGN_IDENTITY='iPhone Developer' >/dev/null 2>&1
What do I want to know, what problems will I carry out if I remove "clean" from the build command? I have a vague understanding of what “clean” does: delete previously compiled objects that will invoke the next build command in order to assemble the entire project from scratch.
However, the complete assembly takes a lot of time on our project, whereas if we do not clean and change a lot, it will only take a few seconds. I would like our pre-commit-hooks to be quick and easy, but I'm worried that the assembly will be in some strange state and will not allow the developer to complete, even if their code is ok.
Will I encounter problems if I do not clean before each assembly for my pre-hook? Perhaps, in some cases, it will incorrectly report a build error or fail if I do not clear it?
source share