I'm new to java/eclipse(coming from .NET), so I'm still unfamiliar how eclipse builds/runs my projects. After examining the .project and .classpath files i'm guessing that they have all the info needed for the eclipse to build the project. I like the kind of control nAnt gives for .NET projects, so I decided to switch Eclipse's Javabuilder for it. The only way I found to build using Ant is to right click the build file and tell eclipse to build it, then a window pops that allows me to select tasks and other options. That is not so bad, however I would be happier if I could still use Eclipse's views for invoking Ant tasks. Is there some way to tell eclipse to invoke ant tasks when I perform actions on the IDE? In the MonoDevelop IDE I can customize the various build-related actions(eg: calling a make or nant command on the project's directory). I really like the jUnit test view better than seeing the test result's on the console. If not, can I customize/integrate JavaBuilder to work alongside with nAnt?
There is a view in Eclipse called Ant:
Window -> Show view -> Ant
You can add build files to it. Then run the target you want by clicking on it.
Is there some way to tell eclipse to invoke ant tasks when I perform actions on the IDE?
Could you please clarify what you mean here? Do you mean when you run a build in Eclipse you would like to invoke an Ant target?
EDIT: Instead of using the default Java builder you can define your own.
- Right click on the project -> properties -> Builders
- Uncheck Java builder
- Select New button -> Ant Builder
- In the launch configuration specify your build file, your base directory, etc
- Finish the wizard.
- To build your project select the Project menu -> Build project.
Eclipse doesn't use Ant for any of its own internal tasks; you can happily compile classes, run tests, produce JAR files, etc, from within Eclipse without Ant. Ant build files are more for tasks done outside the IDE.
Because Eclipse keeps track of its own project state, you don't normally have to do project cleans - the classfiles are consistent.
If you prefer an IDE based around something like an Ant build script, then you may be interested in NetBeans - it is explicitly modelled around the Ant build script.