<project name="JSONDemo" default="test"> <property environment="env"/> <property file="build.properties"/> <path id="classpath"> <pathelement location="build/classes"/> <pathelement location="${commons.beanutils.jar}"/> <pathelement location="${commons.lang.jar}"/> <pathelement location="${commons.logging.jar}"/> <pathelement location="${ezmorph.jar}"/> <pathelement location="${json.lib.jar}"/> <pathelement location="${junit.jar}"/> </path> <target name="clean" depends="clean.test" description="deletes all generated files"> <delete dir="build"/> </target> <target name="clean.test" description="deletes all generated files"> <delete dir="test"/> </target> <target name="compile" depends="prepare" description="compiles source files"> <javac srcdir="src/java" destdir="build/classes" classpathref="classpath" deprecation="on" debug="on"> <compilerarg line="-Xlint"/> </javac> </target> <target name="prepare"> <mkdir dir="build/classes"/> <mkdir dir="test"/> </target> <target name="test" depends="clean.test,compile" description="runs all JUnit tests"> <junit fork="yes" printsummary="yes"> <classpath refid="classpath"/> <batchtest todir="test"> <fileset dir="src/java" includes="**/${test}Test.java"/> </batchtest> <formatter type="xml"/> </junit> <junitreport toDir="test"> <fileset dir="test"/> <report format="frames" todir="test"/> </junitreport> <exec os="Windows XP" executable="cmd.exe"> <arg line="/c start test/index.html"/> </exec> <exec os="Mac OS X" executable="open"> <arg line="-a /Applications/Safari.app test/index.html"/> </exec> </target> </project>
Copyright © 2007 Object Computing, Inc. All rights reserved.