<?xml version="1.0" ?>
<project name="myProject" default="format" basedir="." >
<property name="dir.jalopy" value="/mystuff/jalopy/bin" />
<property name="dir.lib" value="${basedir}/ext/lib" />
<property name="dir.compile" value="${basedir}/tmp~/build/classes" />
<property name="dir.src.java" value="${basedir}/src/java" />
<!-- ==================================================================== -->
<!-- Defines the Jalopy task -->
<!-- ==================================================================== -->
<taskdef name="jalopy"
classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
<!--
we did not copy the needed .jars into the /lib directory of Ant in order
to avoid possible classpath issues, so we have to specify a lookup
classpath here
-->
<classpath>
<fileset dir="${dir.jalopy}">
<include name="*.jar" />
</fileset>
</classpath>
</taskdef>
<!-- ==================================================================== -->
<!-- Defines the project classpath -->
<!-- ==================================================================== -->
<path id="project.classpath" >
<!-- our compilation directory -->
<pathelement location="${dir.compile}" />
<!-- needed 3rd party libraries -->
<fileset dir="${dir.lib}" >
<include name="**/*.jar" />
</fileset>
</path>
<!-- ==================================================================== -->
<!-- Compiles the project sources -->
<!-- ==================================================================== -->
<target name="compile"
depends="init">
<javac destdir="${dir.compile}"
fork="true">
<classpath refid="project.classpath" />
<src path="${dir.src.java}" />
</javac>
</target>
<!-- ==================================================================== -->
<!-- Formats all source files -->
<!-- ==================================================================== -->
<target name="format" depends="compile">
<!--
Invokes Jalopy as follows:
- All formatted files will have unix fileformat (\n)
- Load your code convention from the given url
- Override the convention to use the file history feature
- Override the convention to use alder32 checksums of files for history testing
- Override the convention to use loglevel "info"
- Override the convention to use 2 threads
- The import optimization feature will work (if enabled in the active
convention), because a classpath reference is specified
Don't forget to setup an include pattern as Jalopy truly expects
valid Java source files as input!
-->
<jalopy fileformat="unix"
convention="http://www.foo.com/myConvention.xml"
history="file"
historymethod="adler32"
loglevel="info"
threads="2"
classpathref="project.classpath">
<fileset dir="${dir.src.java}">
<include name="**/*.java" />
</fileset>
</jalopy>
</target>
</project>