Storing IDE Targets in a Separate Ant Script

See Also 

When using a , you sometimes have to write Ant targets for IDE actions. For example, you have to write an Ant target to run a program in the debugger or to compile the currently selected file in the IDE.

If you are not able to write these IDE targets in your project's Ant script, you can set the IDE to read these targets from a separate Ant script.

To map an IDE command to an Ant target in a separate Ant script:

  1. Write the target in a separate Ant script.
  2. In the Files window, expand your project folder node and the nbproject node.
  3. Double-click project.xml to open it in the Source Editor.
  4. Enter the following in <ide-actions>:
      <action name="action_name">
        <script>path_to_Ant_script</script>
        <target>target_name</target>
      </action>

    <script> must precede <target>.

  5. If the command also appears in the project's contextual menu, enter the following in <context-menu>:
      <ide-action name="action_name"/>

For a full guide to configuring free-form projects, see:

See Also
About Free-Form Projects
Creating A Debug Target for a Free-Form Java Project
Creating A Debug Target for a Free-Form Web Project
Mapping an Ant Target to an IDE Command

Legal Notices