xml version="1.0" encoding="utf-8"
<!DOCTYPE project [
<!ENTITY common-config SYSTEM "build-common.xml">
]>
<project name="pat" basedir="." default="help">
<description>
PAT - Persistent Applications Toolkit
http://patsystem.sourceforge.net
</description>
&common-config;
<target name="help">
<echo>
You may run several ant targets:
>
> ant skeleton-app - runs your app found in
> (src/skeleton-app)
>
> ant dist - creates binary library
> of PAT for use in your
> project
>
> ant tests - runs almost all tests
> ant tests2 - runs the rest of tests
>
> ant run-demo-withSnapshot - demo app (with snapshot)
> ant run-demo-withoutSnapshot - demo app
>
> ant run-performance-demo - adjustable performance
> demo
</echo>
</target>
<target name="init" depends="common:init">
</target>
<target name="compile" depends="clean, init"
description="Java sources compilation">
<javac
destdir="${build.classes.dir}"
debug="on"
deprecation="on"
depend="on"
nowarn="on"
optimize="off">
<include name="**/*.java" />
<src path="${src.main.dir}" />
<src path="${src.prevayler.dir}" />
<src path="${src.tests.dir}" />
<src path="${src.skeleton-app.dir}" />
<classpath refid="run_classpath"/>
</javac>
<annotationc compilerclasspathref="run_classpath"
classpathref="run_classpath"
bytecode="true">
<src path="${src.dir}"/>
</annotationc>
<aopc compilerclasspathref="run_classpath"
classpathref="run_classpath"
verbose="false">
<classpath path="run_classpath" />
<src path="${build.classes.dir}" />
<aoppath path="${etc.dir}/" />
</aopc>
</target>
<target name="dist" depends="compile"
description="Creates distribution JARs">
<mkdir dir="${dist.dir}" />
<jar destfile="${dist.dir}/pat-${release}.jar"
basedir="${build.classes.dir}">
<include name="org/nthx/**/*.*"/>
<include name="pat/**/*.*"/>
<exclude name="org/nthx/pat/demo/**/*.*"/>
<exclude name="org/nthx/pat/tests/**/*.*"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Version" value="${release} ${TODAY}"/>
</manifest>
</jar>
<jar destfile="${dist.dir}/prevayler1-for_pat-${release}.jar"
basedir="${build.classes.dir}">
<include name="org/prevayler/**/*.*"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Version" value="${release} ${TODAY}"/>
</manifest>
</jar>
<copy todir="${dist.dir}">
<fileset dir="${jboss.aop.path}">
<include name="**/*-aop.xml" />
</fileset>
</copy>
</target>
<target name="skeleton-app" depends="compile"
description="Runs skeleton app">
<java classname="${app.main.class}"
classpathref="run_classpath"
fork="yes" dir="${build.classes.dir}">
<classpath refid="run_classpath" />
<sysproperty key="jboss.aop.path" value="${basedir}/${jboss.aop.path}" />
<sysproperty key="repository.dir"
value="${basedir}/${repository.dir}/skeleton-app" />
</java>
</target>
<target name="run-demo-withoutSnapshot"
depends="compile"
description="Runs demo, but doesn't take a snapshot" >
<java classname="org.nthx.pat.demo.Driver"
classpathref="run_classpath"
fork="yes" dir="${build.classes.dir}">
<classpath refid="run_classpath" />
<sysproperty key="take.snapshot" value="false" />
<sysproperty key="repository.dir"
value="${basedir}/${repository.dir}/demo" />
<sysproperty key="jboss.aop.path" value="${basedir}/${jboss.aop.path}" />
</java>
</target>
<target name="run-demo-withSnapshot"
depends="compile"
description="Runs demo and takes a snapshot" >
<java classname="org.nthx.pat.demo.Driver"
classpathref="run_classpath"
fork="yes" dir="${build.classes.dir}">
<classpath refid="run_classpath" />
<sysproperty key="take.snapshot" value="true" />
<sysproperty key="repository.dir"
value="${basedir}/${repository.dir}/demo" />
<sysproperty key="jboss.aop.path" value="${basedir}/${jboss.aop.path}" />
</java>
</target>
<target name="run-performance-demo"
depends="compile"
description="Runs adjustable performance demo">
<java classname="org.nthx.pat.demo.PerformanceDemo"
classpathref="run_classpath"
fork="yes" dir="${build.classes.dir}">
<jvmarg value="-Xmx900M" />
<classpath refid="run_classpath" />
<sysproperty key="users.count" value="1099" />
<sysproperty key="take.snapshot" value="true" />
<sysproperty key="repository.dir"
value="${basedir}/${repository.dir}/performance" />
<sysproperty key="jboss.aop.path" value="${basedir}/${jboss.aop.path}" />
</java>
</target>
<target name="check-os">
<condition property="isWindows">
<or>
<os family="windows"/>
<os family="win9x"/>
</or>
</condition>
</target>
<target name="tests-windows-warning" depends="check-os" if="isWindows">
<echo>
WARNING: some tests may not pass on Windows.
This is related to "File.delete() vs. System.gc()"
Windows OS' issue.
</echo>
<sleep seconds="2" />
</target>
<target name="tests"
depends="junit-check, compile, tests-windows-warning"
description="Runs main test cases for PAT" >
<delete verbose="true" dir="${basedir}/${repository.dir}/tests"/>
<junit printsummary="yes"
haltonfailure="yes"
showoutput="yes"
failureproperty="tests.failure"
fork="true" dir="${build.classes.dir}" >
<jvmarg value="-Drepository.dir=${basedir}/${repository.dir}/tests"/>
<jvmarg value="-Djboss.aop.path=${basedir}/${jboss.aop.path}"/>
<classpath refid="run_classpath" />
<formatter type="plain" usefile="false" />
<batchtest fork="yes"
haltonfailure="yes">
<fileset dir="${src.tests.dir}">
<include name="**/*Test.java" />
<exclude name="**/*Recovery*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="tests2" depends="junit-check, compile, tests-windows-warning"
description="Runs Recovery type of tests">
<delete verbose="true" dir="${basedir}/${repository.dir}/tests"/>
<junit printsummary="yes"
haltonfailure="yes"
showoutput="yes"
failureproperty="tests.failure"
fork="true" dir="${build.classes.dir}" >
<jvmarg value="-Drepository.dir=${basedir}/${repository.dir}/tests"/>
<jvmarg value="-Djboss.aop.path=${basedir}/${jboss.aop.path}"/>
<classpath refid="run_classpath" />
<formatter type="plain" usefile="false" />
<batchtest fork="yes"
haltonfailure="yes">
<fileset dir="${src.tests.dir}">
<include name="**/*RecoveryTest.java" />
</fileset>
</batchtest>
<batchtest fork="yes"
haltonfailure="yes">
<fileset dir="${src.tests.dir}">
<include name="**/*RecoveryConfirmationTest.java" />
</fileset>
</batchtest>
</junit>
</target>
</project>