Java Reference
In-Depth Information
Using execution triggers to execute Ant targets before running or testing
When you're using IDEA 's execution feature to
launch, debug, or test applications (discussed later
in this chapter and in the next chapter), you may
need to execute an Ant target before or after doing
so to prepare your project if you're relying on Ant's
functionality. This can be accomplished with the
use of an execution trigger . You assign an execution
trigger by right-clicking the target in the Ant
Build window and selecting Execute On | Before
Run/Debug from the menu, which brings up the
dialog shown in figure 5.9.
From the dialog, select the types of executions
you want to trigger the selected Ant target. The
execution types supported by IDEA are presented
as a tree structure. A checkmark by the execution
type (Application, Applet, JU nit, and so forth)
indicates that all execution configurations of that
type will by default trigger your Ant target. For example, if you select JU nit, the
Ant target you select will execute before (or after) any JU nit configuration is run.
If you've defined configurations for a particular type, they're listed under it,
allowing you to narrow the scope to particular configurations only (more about
Run/Debug configurations later in this chapter).
Figure 5.9 The Execute On
feature for Ant build files lets you
add complex scripting elements to
almost any stage of the code-
build-test process in IDEA.
5.2.5
Following Ant's progress in the Messages window
When you execute an Ant target, it displays its output progress to a tab in the
Messages window. Each build file gets its own tab, but all executions against that
build file reuse the tab, destroying any messages already there. You can maintain
the messages tab for a file by right-clicking the tab name and selecting the Pin
Ta b command. Briefly, the toolbar buttons perform the following tasks:
Rerun ( Ctrl+F5 ) executes the build target again. This is a quick way to
build again after fixing any errors you encountered.
Pause Output, when enabled, suspends output from the Ant build process,
even though the Ant process itself continues to execute. Click this option
again to resume the display of output.
Stop aborts a currently running build.
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search