You can integrate the command line export with your ant script (read about ant at
ant.apache.org) by using
the export task
that is provided in {JProfiler installation directory}/bin/ant.jar.
To make the export 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="export"
classname="com.jprofiler.ant.ExportTask"
classpath="C:\Program Files\jprofiler4\bin\ant.jar"/>
<target name="export">
<export snapshotfile="c:\home\ingo\test.jps">
<view name="CallTree" file="calltree.html"/>
<view name="HotSpots" file="hotspots.html">
<option name="expandbacktraces" value="true"/>
<option name="aggregation" value="class"/>
</view>
</export>
</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.
|