3.15.1.3. Application Identity Tool Ant Task

The application identity tool task allows you to invoke the application identity tool directly from within the Ant build process. The task’s parameters correspond exactly to the long versions of the command-line arguments to the org.apache.openjpa.enhance.ApplicationIdTool.

The application identity tool task accepts a nested fileset tag to specify the files that should be processed. You can specify .java or .class files. If you do not specify any files, the task will run on the classes listed in your persistence.xml file or openjpa.MetaDataFactory property.

Following is an example of using the application identity tool task in a build.xml file:

Example 172. Invoking the Application Identity Tool from Ant
<target name="appids">
  <!-- define the appidtool task; this can be done at the top of     -->
  <!-- the build.xml file, so it will be available for all targets   -->
  <taskdef name="appidtool" classname="org.apache.openjpa.ant.ApplicationIdToolTask"/>

  <!-- invoke tool on all .jdo files below the current directory     -->
  <appidtool>
    <fileset dir=".">
      <include name="**/model/*.java" />
    </fileset>
    <codeformat spaceBeforeParen="true" braceOnSameLine="false"/>
  </appidtool>
</target>