[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Bind key to specific Ant target

Felix Dorner wrote:
I don´ t know whether it´ s possible to run an arbitrary system command from eclipse.

Although that would duplicate how I do it from my text editor, I don't really need that; in fact I want to invoke Ant using the IDE's tools. What I would like is a way to assign keystrokes that will call specific Ant targets in the build for the project holding the file I'm currently editing. This will work for me because every build has "clean", "compile", and "test" targets. Many have "jar", "war", or "deploy" targets as well.


Regarding ant build files I guess you already have read

http://help.eclipse.org/help33/topic/org.eclipse.platform.doc.user/gettingStarted/qs-85_ant_configs.htm

No, I hadn't run across it. It looks useful, but I think it doesn't quite do what I'd like. First, I don't see how to connect this up to a keystroke. Window > Preferences > General > Keys seems to list a fixed set of commands that I can pick from and the newly created entry in the Run > External Tools menu isn't on the list. Second, even if it did, this would be specific to the project. I would really like a means to do this based upon the file I'm editing. If I'm in the middle of editing a file in Project A, I'd like a quick keystroke that will run the "compile" task in the ant script for A. But if I'm in Project B instead, I want that same keystroke to run the "compile" task in the script for B.



This way you would create a "launch configuration", then Run... is certainly available through a shortcut, and you´d just select the configuration to launch.

How could I make this available through a shortcut, or are you talking about the shortcuts for the menus (on my Win32 machine that would be ALT-R > E > 1 for the just-created configured run of Ant)?


Thanks for the suggestion, and I'll keep plugging away to see if I can get it to work.

  -- Scott