>Tearing Ant from JDT

>….is going to need a crow bar, a couple of sticks of dynamite, and a lot of beer. I wasn’t surprised to see how closely tied to the JDT core and debug/launch UI that the Ant Launching support is. Mainly for the use of the JRE Tab and the Classpath Tabs, however what was a bit more surprising is how closely tied to JDT the ANT Editor itself is. I have no problem with JDT depending on ANT for some functionality, but it just seems wrong to have ANT depend on JDT for functionality, the two don’t necessarily need to go together.

I was looking into trying to help refactor some of this out into some common components that could be broken into smaller packages to address bugs: 213855 and 54753.

The later has been an open request for the last 4 years and keeps getting pushed off, the latest comment being that it would be best to do during the e4 refactoring. However, I have the need now, not later to get this out for an XML IDE that I work on that is based on eclipse. I don’t want or need full JDT/Java editing support, just pieces to help run some applications. Ant is one of the applications, but the XSL Tools project also needs to leverage the JRE and Classpath tabs for the Java specific XSL processors like Xalan and Saxon.

Unfortunately, while it looks on the surface that the Ant related projects are their own separate packageble pieces, they actually are pretty heavily tied to jdt.ui and jdt.debug. One thing that could help here is if JDT could do something similar to what Web Tools has done. Create a set of Java Commons plugins, that contain the necessary standalone classes that are common to basic java runtime support. Some of this is in JDT Core, but that also contains a whole boat load of stuff that really isn’t necessary or needed in the ability to just do runtime and jre selection, or classpath.

How much work this would be I’m not sure, as I’ve only started scratching the surface, but it might be something I’ll fiddle with to see if I can get it down to basics of what is needed. There are a lot of use cases where having just the JRE and Classpath support for launching java application can be helpful, it’s hard to believe that this hasn’t been a more requested feature.

One other thing that could be done is to build the Ant editor off of the Web Tools XML editor, this already provides most of the editing functionality, but still would require some special handling for content assistance, and some ant specific functionality for variable handling.

Advertisements
This entry was posted in ant, eclipse, xml. Bookmark the permalink.

3 Responses to >Tearing Ant from JDT

  1. >RE: “I have no problem with JDT depending on ANT for some functionality, but it just seems wrong to have ANT depend on JDT for functionality, the two don’t necessarily need to go together.”I’d say it is the opposite. Ant is all Java and needs Java to run, so you’d reuse some JDT UI to Run/Debug Ant stuff, well, maybe those things should be separated out from the JDT itself, so others who need to run Java processes. Right now you have to keep whole JDT for that.But why on Earth JDT editors would need to depend on any of the Ant stuff is beyond my comprehension.

  2. >Probably because it is an ant editor in the jdt that is older than the Eclipse Foundation. You just know if it is pulled out of the JDT the first feature request after 1.now is going to be for something else out of the JDT. Add the dependency and go.

  3. David Carver says:

    >Well, the JDT Editor itself might not need to depend on ANT, but JDT might need to depend on ANT for some of the core functionality and the build script support during compilation.I think it can be refactored a bit better so that at least the ANT editor doesn’t need classes that are also used by the JDT editor. If they must be shared refactor them to a jdt.common project so that a minimal set can be used.Best thing is to probably just rewrite the ANT editor.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s