<!--
Copyright (c) 2006-2007 Julias R. Shaw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
<project name="SDB_Pan" basedir="." default="metrics">
<property name="panopticode_dir" location="c:/panopticode/"/>
<import file="${panopticode_dir}/panopticode-imports.xml" optional="true" />
<property name="version"
value="2.1" />
<target name="clean">
<delete dir="target" />
</target>
<target name="compile">
<delete dir="target/classes" />
<mkdir dir="target/classes" />
<javac debug="true" destdir="target/classes">
<src path="src"/>
<classpath>
<fileset dir="${basedir}" includes="lib/**/*.jar" />
<pathelement location="target/classes" />
<pathelement location="${basedir}/src" />
</classpath>
</javac>
</target>
<target name="metrics" depends="clean">
<panopticode projectDir="${basedir}"
projectName="${ant.project.name}"
projectVersion="${version}"
srcDir="src"
panopticodeDir="${panopticode_dir}"
/>
</target>
<target name="unit-test">
<javac debug="true" destdir="target/classes">
<src path="tests"/>
<classpath>
<fileset dir="${basedir}" includes="lib/*.jar" />
<pathelement location="target/classes" />
</classpath>
<compilerarg value="-Xlint:unchecked" />
</javac>
<mkdir dir="target/rawmetrics/xml/junit" />
<path id="unittest.path">
<fileset dir="${basedir}" includes="lib/*.jar" />
<fileset dir="${basedir}" includes="lib/**/*.jar" />
<pathelement location="target/classes" />
</path>
<panopticode-junit unitTestClasspathId="unittest.path"
outputDir="target"
panopticodeDir="${panopticode_dir}">
<batchtest todir="target/rawmetrics/xml/junit">
<fileset dir="target/classes" includes="**/*Test.class"/>
</batchtest>
</panopticode-junit>
</target>
<target name="rasterize-all-reports" depends="rasterize-png-reports,rasterize-jpeg-reports,rasterize-tiff-reports"/>
<target name="rasterize-png-reports">
<delete dir="target/reports/png" />
<mkdir dir="target/reports/png" />
<svg-to-png srcFile="target/reports/svg/complexity-treemap.svg"
destFile="target/reports/png/complexity-treemap.png" />
<svg-to-png srcFile="target/reports/svg/coverage-treemap.svg"
destFile="target/reports/png/coverage-treemap.png" />
<svg-to-png srcFile="target/reports/svg/complexity-treemap.svg"
destFile="target/reports/png/complexity-treemap-thumb.png"
width="128"
height="96"/>
<svg-to-png srcFile="target/reports/svg/coverage-treemap.svg"
destFile="target/reports/png/coverage-treemap-thumb.png"
width="128"
height="96"/>
</target>
<target name="rasterize-jpeg-reports">
<delete dir="target/reports/jpeg" />
<mkdir dir="target/reports/jpeg" />
<svg-to-jpeg srcFile="target/reports/svg/complexity-treemap.svg"
destFile="target/reports/jpeg/complexity-treemap.jpg" />
<svg-to-jpeg srcFile="target/reports/svg/coverage-treemap.svg"
destFile="target/reports/jpeg/coverage-treemap.jpg" />
<svg-to-jpeg srcFile="target/reports/svg/complexity-treemap.svg"
destFile="target/reports/jpeg/complexity-treemap-thumb.jpg"
width="128"
height="96"/>
<svg-to-jpeg srcFile="target/reports/svg/coverage-treemap.svg"
destFile="target/reports/jpeg/coverage-treemap-thumb.jpg"
width="128"
height="96"/>
</target>
<target name="rasterize-tiff-reports">
<delete dir="target/reports/tiff" />
<mkdir dir="target/reports/tiff" />
<svg-to-tiff srcFile="target/reports/svg/complexity-treemap.svg"
destFile="target/reports/tiff/complexity-treemap.tif" />
<svg-to-tiff srcFile="target/reports/svg/coverage-treemap.svg"
destFile="target/reports/tiff/coverage-treemap.tif" />
<svg-to-tiff srcFile="target/reports/svg/complexity-treemap.svg"
destFile="target/reports/tiff/complexity-treemap-thumb.tif"
width="128"
height="96"/>
<svg-to-tiff srcFile="target/reports/svg/coverage-treemap.svg"
destFile="target/reports/tiff/coverage-treemap-thumb.tif"
width="128"
height="96"/>
</target>
</project>