Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flagging errors from inside a Run Script build phase



Hi, 

don't know about scripts but in a test case you can do things like:

printf("error: ...");

or 

printf ("warning: ...")

The "error:" or "warning:" prefix does the trick nicely

Ruotger

Am 27.01.2006 um 16:04 schrieb Dave McCaldon:


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.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

---
Failure is not an option, It's a privilege reserved for those who dare to try.

Ruotger Skupin, Mac OS X Software Engineering

ilink Kommunikationssysteme GmbH
Münzstr. 13; 10178 Berlin - Germany



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.