Running Ant Scripts
When you double-click an Ant project node, its default target is run. You
can configure the Ant script to run a different target when it is executed inside
the IDE. You can also run specific targets using commands in the Ant project
node's contextual menu, or by creating a shortcut to the target.
You can run a specific target in either of the following ways:
- Right-click the Ant project node and choose the target from the Run Target
submenu.
- Expand the Ant project node and double-click the target node.
To create a shortcut to a target:
- Choose File
New from
the main window.
- In the New wizard, expand the Ant Build Scripts node, select Shortcut to
Target, and click Next.
- In the Choose Options panel of the wizard, choose where you want to place
the target and whether you want to customize its Ant code. Click Next to proceed.
- Choose the target in the Select Ant Target panel. The target you want to
create a shortcut for must already exist in a mounted filesystem. A shortcut
can only point to one target. Click Next to proceed.
- In the Customize Script panel, add or change any of the Ant script's elements,
such as tasks or properties. This panel only appears if you selected the Customize
generated Ant code checkbox in panel 2.
- In the remaining panels of the wizard, choose which projects, toolbar, menu,
or keyboard shortcut to assign the shortcut to. Make sure you do not overwrite
any existing keyboard shortcuts. You can view existing keyboard shortcuts
by choosing Tools
Keyboard
Shortcuts. The wizard only shows those steps that you selected in panel 2.
- When you have specified all of the necessary information, click Finish.
The shortcut is created in the specified locations.
To configure an Ant project to run a target other than the default target:
- Right-click the Ant project node and choose Properties.
- In the Execution tab of the Properties window, click the Executor property,
then click its ellipsis (...) button.
- In the Executor dialog box, and click the Run Target(s) property and add
the targets you want.
This action makes the targets the default targets run by all Ant scripts
that use Ant Script Execution. If you only want to apply the change to certain
files, make a custom copy of the executor, set the default targets it runs,
then set your script to use the custom executor. For more information about
creating custom executors, see Defining a New
Executor Type.
Legal Notices