简体   繁体   中英

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

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

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...)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM