Java Reference
In-Depth Information
panel, accessible from
IDE
Settings
(see chapter 12). Each Ant target in the
project is listed under the
Keymap
editor's
Ant Targets
hierarchy. To assign a
keyboard shortcut to an Ant target, follow these steps:
Right-click the target in the Ant Build window to access its context menu.
1
Select the option
Assign Shortcut
to bring up the
Keymap
dialog.
2
Click
Add Keyboard Shortcut
3
Press the key combination you wish to assign to the build target.
4
If desired, enable a second keystroke and enter it as well.
5
If there are no conflicts, click
OK
to commit the assignment.
6
Automating the build process with Ant target triggers
As alluded to earlier in the chapter, it's possible to integrate Ant with other
aspects of
IDEA
such as its built-in compiler, debugger, and execution features.
Each target can be individually configured to automatically run in response to
several different types of triggers, all linked back to the
IDE
.
Using compilation triggers to add Ant to the build
If you're relying on Ant targets to complete critical steps of your build, you'll want
to configure a compilation trigger. You can configure Ant targets to execute
before or after
IDEA
's internal compiler has completed executing. You can also
execute the target both before and after, if the need arises. If a compilation fails,
Ant targets linked to the end of the compilation aren't executed. Note that this
compilation trigger only applies to the built-in project builder, not to any compi-
lation your Ant build performs. Any target dependency based on Ant directed
compilations should be specified as part of your Ant file.
To establish a compilation trigger, right-click the target you wish to run and
select either
Execute on | Before Compilation
or
Execute on | After Compila-
tion
from the menu. Your choice will be reflected with a checkmark beside the
enabled option. Selecting an option again removes the trigger. When active, the
trigger is listed in the
Ant Build
window in parentheses next to the target name,
as a reminder.