• 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: Wed, 2 Sep 2009 15:41:37 -0400


Nice work, Tom -- I think we're almost there.

The only problem I found with your script is that it fails if you have whitespace in the path to your source code. If I get a little time later on, I'll modify your script to handle that additional case.

While I was playing with the script, I renamed my "/usr/bin/ant" to "/ usr/bin/ant-1.7.0" and I made "/usr/bin/ant" a symlink to the script (which, in turn, was modified to reference /usr/bin/ant-1.7.0). This has the advantage of applying the corrected ANT output system-wide.

This fix looks quite promising indeed.

Thanks!

-Mike Ellis

On Sep 2, 2009, at 3:11 PM, email@hidden wrote:

Hi,

I have a workaround for the "error" bug in Ant that allows Xcode to display errors in the build window with links to the error (including bubbles) in the source file. The workaround involves two files (a script to substitute for the ant command and a sed script to process the ant output). To avoid file stripping I include the content of each script below. Place both scripts in the same directory (wherever you want).

The two scripts are xant and errorsub.sed. Call xant in place of ant.

xant calls ant passing any arguments to it and pipes the output to the errorsub sed script. The errorsub sed script ignores any lines with the warning signature since we want to preserver those. For all other lines, it looks for instances of an integer bounded by colons on either side. This is how line numbers are posted by ant. For such matches, it substitutes for the line number signature the line number signature (since we want to preserver it) followed by "error:". When Xcode sees the "error:" it identifies the line was an error and the rest just works.

I hope this helps. It works for me.

best regards,
tom

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:/ }


========================= 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


  • Prev by Date: Re: Problem with NSFileManager
  • Next by Date: Re: Xcode 3.2 fails to highlight errors in Java source
  • 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