Eclipse – Extract eclipse project .classpath dependencies into ant script

anteclipsejavac

I have a list of Eclipse projects that I would like to compile based on the existing project configuration.

As far as I can tell, if an ant script could read the .classpath files, it would pretty much be able to infer the project dependencies and perform a "javac" compilation in the right order. This would save time in describing the same dependencies again in the ant script or a Makefile.

The dependencies I am interested in are JAR Dependencies, JRE dependencies, and inter-project dependencies. These are — as far as I can tell — part of the .classpath XML file.

Any ideas on how Eclipse project dependencies could used in an ant script?

Best Answer

Right click on your Project -> Export "General/Ant Buildfiles". Choose the projects and there you go.

Otherwise... I have some experience with ant4eclipse and it is a hassle to get it stable.

Go check Buckminster or Maven Tycho for a good solution.