Originally posted by JiaPei Jen:
Thanks. I have viewed the Eclipse Help --> Workbench User Guide --> Concepts --> External Tools --> Ant Support.
The documentation has answered many of my questions.
But, the documentation does not seem to explain how to "create" an ANT file (I suppose it is always called build.xml) within the Eclipse.
Do I simply use the Eclipse editor and type up my ANT script and save it as build.xml? And then put this file to the ANT classpath under the Eclipse Window > Preferences > Ant > Runtime?
Thanks.
An Ant buildfile doesn't have to be named build.xml - that's just the default name, although I don't know offhand how to let Eclipse know that a file with some other name should display the Ant context menus when right-clicked.
There's no Eclipse toll I know of to build Ant build.xml files, but then Eclipse can do simple builds automatically, so unless you have a custom build process (or are like me and always support IDE-free builds), you don't need Ant.
You don't have to put the build.xml in anyone's CLASSPATH ever, Eclipse or no Eclipse. Ant reads this file as a data file when it's invoked. However, the Eclipse IDE allows you to set Ant context info for use when invoking Ant under Eclipse. It allows Ant in Eclipse to get the same benefits you'd have when running it from the command line where you'd possibly select an alternate target, set up override properties, have an extensive external build CLASSPATH and so on.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.