Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding buttons with shortcuts, or shortcuts only for ant tasks in Eclipse

Tags:

java

eclipse

ant

I am working on a project which has an Ant script for all lifecycle phases. The project, divided in small projects, is meant to be developed with Eclipse. The common version is the Indigo One.

Basically I am interested on putting a series of buttons with a shortcut each, or at least a shortcut only, to execute some of the main tasks. The relevant tasks are:

  • fast build: this involves only the front end classes and jsps, I have solved this easily in the builders panel by adding an Ant build which call the task, for later review with the buttons issue, because there's no shortcut for the "Project->Build Project"
  • full build: occasionally I need to launch a task for a complete build, which is taking quite some time in respect to a simple build
  • deploy: this task simply packs the war file and deploy to a local jboss location, at the moment I am launching the jboss server manually via shell script, but I was thinking for a convenient way to have it launched by Eclipse if not already started

thanks

like image 746
Leonardo Avatar asked Apr 30 '12 08:04

Leonardo


2 Answers

You can add a couple of "ant build" launch configurations to run your ant script(s) with specified ant targets and configuration.

Run>External Tool...>External Tools Configurations... and then select "ant build" and press "New launch configuration". On "Main" tab specify buildfile and directory on "Target" select targets you want to run on "Properties" add additional properties or specify property file.

It would be also a good idea to give each of launch configurations a descriptive name.

Later you can add your defined configuration to favorites for convenience and use them from External Tools (down arrow) on the toolbar (See: Run>External Tool...>Organize Favorites...)

like image 146
Jan Arciuchiewicz Avatar answered Sep 21 '22 19:09

Jan Arciuchiewicz


You can use the Ant view, which is integrated into Eclipse. Press Ctrl+3 (cmd+3 on mac I think) and type Ant, and then open the view. Click on "Add buildfile" and add the relevant build file. It'll then have the ant tasks listed in the view which you can just run from there.

like image 38
Deco Avatar answered Sep 20 '22 19:09

Deco