The Artima Developer Community
Sponsored Link

Java Buzz Forum
Free Eclipse Classpath Ant Task

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Joey Gibson

Posts: 71
Nickname: joeygibson
Registered: Jun, 2003

Joey Gibson is an opinionated software architect who blogs about technology, politics, music, etc.
Free Eclipse Classpath Ant Task Posted: Jun 17, 2004 9:35 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Joey Gibson.
Original Post: Free Eclipse Classpath Ant Task
Feed Title: Joey Gibson's Blog
Feed URL: http://www.jobkabob.com/index.html
Feed Description: Thoughts, musings, ramblings and rants on Java, Ruby, Python, obscure languages, politics and other exciting topics
Latest Java Buzz Posts
Latest Java Buzz Posts by Joey Gibson
Latest Posts From Joey Gibson's Blog

Advertisement
I've just released version 1.0 of a free Ant custom task to make it a little easier to work on a project using both Ant and Eclipse. What this task does is read the .classpath file that Eclipse uses to maintain your project's classpath, combines that with your Eclipse preferences to expand classpath variables and then creates a path-like structure in your Ant project that you can compile against.

I wrote this because I use Eclipse and I always also have a build file. Keeping the two in sync, classpath-wise, was always a hassle. Now I can simply update the classpath inside Eclipse, and whenever I do an Ant build it will automatically be in sync.

I wrote it against Eclipse 3.0 M8 originally. Then I upgraded to M9 and it stopped working. So with a bit of futzing about, I got it to work with both 3.0 versions and 2.1.3, all three of which keep the preferences file in completely different places with completely different names. But that's taken care of now. I have also tested on both WindowsXP and Linux, but more on XP than Linux.

To use it, drop the jar file (plus jdom.jar if you don't already have it) in ANT_HOME/lib. Then taskdef the task
<taskdef resource="com/joeygibson/ant/eclipseclasspath.properties"/>
Then call the task. There are several optional attributes, but if you want the classpath to end up in a path called "classpath", then you can probably get by with just this
<eclipsecp workspace="/home/me/workspace"/>
If you are on Windows, and using Eclipse 3.0 M8 or later and you keep your workspace in C:/Eclipse/workspace then you don't even have to do that much. You can get by with
<eclipsecp/> 
Once you've executed the task, just reference the newly-created path from your javac task or anything else that takes a path as an argument.

You can read more about it in the README.txt

I've got several downloadable versions available, in both zip and tar.gz formats, with and without source, and with and without jdom.jar. If you use it and like it/don't like it/have suggestions, please let me know.

Downloads
Binary only ect.zip
ect.tar.gz
Binary w/ JDOM ect-with-jdom.zip
ect-with-jdom.tar.gz
Source only ect-src.zip
ect-src.tar.gz

I've heard there are other tools out there that do this, but I didn't find them, so I wrote my own. Please email me with any comments you have about it.

Read: Free Eclipse Classpath Ant Task

Topic: Interview with T.J. Rodgers Previous Topic   Next Topic Topic: The OR mismatch. Microsoft has it on its radar screen

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use