• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode 3.2 fails to highlight errors in Java source
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode 3.2 fails to highlight errors in Java source


  • Subject: Re: Xcode 3.2 fails to highlight errors in Java source
  • From: Michael Ellis <email@hidden>
  • Date: Thu, 3 Sep 2009 09:08:39 -0400


Hi Greg.

I was just about to work on Tom's script when I discovered you had fixed it already. Thanks!

I have now configured my "/usr/bin" directory to contain the following:
1) rwxr-xr-x 1 root wheel 26 Sep 3 08:51 ant -> ant- fix-error-reporting.sh
2) lrwxr-xr-x 1 root wheel 22 Aug 24 14:34 ant-1.7.0 - > /usr/share/ant/bin/ant
3) -rwxr-xr-x 1 root wheel 213 Sep 3 08:51 ant-fix- error-reporting.sh
4) -rw-r--r-- 1 root wheel 44 Sep 2 15:25 ant-fix- errorsub.sed


Where:
#1 : "/usr/bin/ant" has been replaced with a symlink to the same script as the "xant" script provided below.
#2 : The original "ant" symlink has been renamed to "ant-1.7.0" to move it out of the way.
#3 : "ant-fix-error-reporting.sh" is my name for the "xant" script provided below.
#4 : "ant-fix-errorsub.sed" is my name for the "errorsub.sed" script originally given by Tom (see below)


Now when you invoke "ant" from the command line, you're really invoking "ant-fix-error-reporting.sh", which in turn, corrects the error reporting format from ANT. Because this change globally corrects output from ANT, errors now show up propertly in Xcode for all ANT projects.

It would be nice if, in the future, this error reporting issue was addressed by Apple. I can think of two ways:
Fix #1: Enhance Xcode 3.2 to interpret ANT's output similar to the way this sed script does.
- OR -
Fix #2: With the developer tools, possibly bundle a newer version of ANT that emits correctly formatted output for errors (if the current ANT version does not fix the error output, submit a patch that does fix it).


Even still, I think we have a good interim solution here.

Thanks to all involved.

Regards,
Mike Ellis


On Sep 2, 2009, at 9:53 PM, email@hidden wrote:

Pelaia II, Tom wrote:

xant:
#!/bin/bash

# get the root directory of this script
root_dir=${0%/*}
echo $root_dir

# execute the ant command and perform the substitution
ant $* | sed -f $root_dir/errorsub.sed

errorsub.sed:
/: warning:/! {
s/\(:[0-9]*:\)/\1 error:/
}

Thanks for doing the investigation and script, Tom. Fixes for 'xant' follow:

#!/bin/bash

# get the root directory of this script
root_dir="${0%/*}"
echo "$root_dir"

# execute the ant command and perform the substitution
ant "$@" | sed -f "$root_dir/errorsub.sed"


FWIW, there's probably an 'awk' or 'perl' script that would work with only command-line args, instead of needing a separate 'sed' script. I'm not enough of an awker or perlite to whip one up without RTFM'ing, though.

  -- GG


========================= Michael F. Ellis President Ellis Softworks Inc. ---------- Phone: (941) 713-0361 Email: 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


  • Follow-Ups:
    • Re: Xcode 3.2 fails to highlight errors in Java source
      • From: "Pelaia II, Tom" <email@hidden>
  • Prev by Date: Re: Any hope to get an updated Xcode IDE for Leopard?
  • Next by Date: How to file a bug in Rez tool for Intel processor?
  • Previous by thread: Re: Xcode 3.2 fails to highlight errors in Java source
  • Next by thread: Re: Xcode 3.2 fails to highlight errors in Java source
  • Index(es):
    • Date
    • Thread