views:

25

answers:

1

Hi all, my question relates to the Ant libs and source included with various Eclipse distributions. e.g.

eclipse/plugins/org.apache.ant_1.7.1.v20090120-1145 and eclipse/plugins/org.apache.ant.source_1.7.1.v20090120-1145.jar

How can I associate these together? What I'd like to do is set a breakpoint in the Ant Javac task, so I can confirm precisely which arguments are being passed to it. (This is proving very difficult to analyse from the build.xml itself due to a complicated structure with lots of imports and taskdefs).

I can see no way to associate them within Preferences/Ant, and when adding the jar to my Ant launcher's classpath it seems to just ignore my breakpoints in it, no matter even if I put it higher on the classpath than "Ant Home (Default)" itself.

I'm presumably missing something obvious, your answers are much appreciated.

A: 

You can configure your Run Configuration. Go to Run -> Run Configurations... -> Source tab, and press Add button. From here you can add it as external archive. If you have it configured as variable, you can also use this option.

amorfis
I don't see my Ant configurations there. They live under Run > External Tools instead. Although that dialog allows you to modify Ant's CLASSPATH, I can't see any way to attach sources...
Iain
You still can add ant sources jar as external archive. Just choose this option and navigate to eclipse/plugins/org.apache.ant.source_1.7.1.v20090120-1145.jar This should work.
amorfis
(By the way, thanks for your suggestions, I appreciate them!) I have now added the source that way, but what I really need is to have Eclipse install breakpoints within the code. I can't see how to even open the code to set the breakpoint without having the ant code also on the project-wide Java Build Path - fair enough, I've added that too.Regardless, it doesn't seem to install my breakpoints in org.apache.tools.ant.taskdefs.Javac. (normally I'd see a little tick on the breakpoint icon while the code is running).Don't suppose you have any other ideas?
Iain
(Hmmm, I suppose that now I have Ant on my project build path - what I actually need is to create a *Run* Configuration that runs ant. Shouldn't be difficult I guess. I'll give it a try...)
Iain
The problem seems to be that you are not invoking ant from this added code. Instead of running ant as external tool, you should run it as regular eclipse class with main() etc. I don't know how, but look for class with main() in ant, then run this main, of course with appropriate arguments.
amorfis