Yes, exit 1 causes a build error:
Command /bin/sh failed with exit code 1
But my script does a number of things and any one of these can fail, so I'd really like it to say:
RegModule /foo/bar failed with error nnnn
But even with exit 0, Xcode somehow detects the error message from rm when you try to remove a non-existent file. There's some magic there, I just don't know what. I had hoped it would be one of:
* The word "ERROR" in the script output
* Anything written to stderr
Xcode must be hard coded to look for specific output, you can add this to your script:
echo "rm: /tmp/x: No such file or directory"
And it will flag it as an error, but even change the case on one character and it doesn't flag.
I guess I'll have to live with exit 1 then!
Thanks.
On Jan 27, 2006, at 4:28 AM, Jonas Maebe wrote:
On 27 jan 2006, at 03:35, Dave McCaldon wrote:
If I have a Run Script Build Phase, and my script determines there's an error, how do I "raise" that to Xcode? There already seems to be some smarts in Xcode, for example if you add the following to your script:
rm /tmp/foobar
Assuming the file doesn't exist, this will be flagged as a build error:
rm: /tmp/foobar: No such file or directory
This is great, I can click on error in the build results and it takes me to the raw output from the script. However, I just don't seem to be able to get it to work with my own errors.
I tried the obvious stuff like redirecting my errors to stderr, or putting keywords such as "ERROR:" in the output, but alas Xcode doesn't seem to notice it.
Do you exit your script with a non-zero exit code? (e.g. "exit 1") I do have to admit how exactly XCode determines what is an error and what isn't is black magic to me as well, and it doesn't seem to be documented anywhere.
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Help/Unsubscribe/Update your Subscription:
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Help/Unsubscribe/Update your Subscription: