Integrating JProfiler with your ant script (read about ant at
ant.apache.org)
is easy. Just use the profile task
that is provided in {JProfiler installation directory}/bin/ant.jar
instead of the java task. The profile task
drop in replacement for the the java as it supports
all its attributes and nested tasks. In addition, it has a number of
additional attributes that govern how the application is profiled.
Note: At least ant 1.6.3 is required for the profile task
to work.
To make the profile task available to ant, you
must first insert a taskdef element that tells
ant where to find the task definition. Here is an example of using the
task in an ant build file:
<taskdef name="profile"
classname="com.jprofiler.ant.ProfileTask"
classpath="C:\Program Files\jprofiler4\bin\ant.jar"/>
<target name="profile">
<profile classname="MyMainClass" offline="true" sessionid="80">
<classpath>
<fileset dir="lib" includes="*.jar" />
</classpath>
</profile>
</target>
The taskdef definition must occur only once per
ant-build file and can appear anywhere on the top level below the
project element.
Note: it is not possible to copy the ant.jar archive to
the lib folder of your ant distribution. You have to reference a full
installation of JProfiler in the task definition.
|