1<project name="doclava" default="jar"> 2 <property name="jar.dir" value="build/dist/doclava"/> 3 <property name="jar.file" value="${jar.dir}/doclava.jar"/> 4 5 <property environment="env"/> 6 <property name="javahome" value="${env.JAVA_HOME}" /> 7 <property name="jsilver" value="lib/jsilver.jar"/> 8 <property name="junit" value="lib/junit-4.8.2.jar"/> 9 10 <path id="classpath.test"> 11 <pathelement location="${junit}" /> 12 <pathelement location="${jar.file}" /> 13 <pathelement location="build/test" /> 14 </path> 15 16 <target name="compile" description="Compile Java source."> 17 <mkdir dir="build/classes"/> 18 19 <javac srcdir="src" 20 debug="on" 21 destdir="build/classes" 22 source="1.5" 23 target="1.5" 24 extdirs=""> 25 <compilerarg value="-Xlint:all"/> 26 <classpath> 27 <pathelement location="${jsilver}"/> 28 </classpath> 29 </javac> 30 </target> 31 32 <target name="jar" depends="compile" description="Build jar."> 33 <mkdir dir="${jar.dir}"/> 34 35 <copy todir="build/classes/assets"> 36 <fileset dir="res/assets"/> 37 </copy> 38 39 <jar jarfile="${jar.file}" manifest="src/MANIFEST.mf"> 40 <fileset dir="build/classes"/> 41 <zipfileset src="${jsilver}" /> 42 </jar> 43 </target> 44 45 <target name="clean" 46 description="Remove generated files."> 47 <delete dir="build"/> 48 </target> 49 50 <target name="clean-jar" 51 description="cleans and builds a .jar" 52 depends="clean,jar"> 53 </target> 54 55 <target name="compile-test"> 56 <mkdir dir="build/test" /> 57 58 <exec executable="/bin/sh"> 59 <arg value="-c"/> 60 <arg value="find test/doclava/sample -name '*.java' > build/test/src-list"/> 61 </exec> 62 63 <javac srcdir="test" destdir="build/test"> 64 <classpath refid="classpath.test" /> 65 </javac> 66 </target> 67 68 <target name="test" depends="jar,compile-test"> 69 <junit> 70 <classpath refid="classpath.test" /> 71 <formatter type="brief" usefile="false" /> 72 73 <batchtest> 74 <fileset dir="build/test"> 75 <include name="**/*Test.class"/> 76 </fileset> 77 </batchtest> 78 </junit> 79 </target> 80 81 <target name="doclava" description="Generate documentation"> 82 <taskdef name="doclava" classname="com.google.doclava.DoclavaTask" classpath="${jar.file}"/> 83 84 <mkdir dir="build"/> 85 <exec executable="/bin/sh"> 86 <arg value="-c"/> 87 <arg value="find ./src -name '*.java' > build/src-list"/> 88 </exec> 89 90 91 <doclava> 92 <arguments> 93 -quiet 94 -bootclasspath "${javahome}/jre/lib/rt.jar" 95 -doclet com.google.doclava.Doclava 96 -docletpath ${jar.file} 97 -classpath ${jar.file} 98 -d build/api 99 -hdf project.name "Junction" 100 -stubs build/stubs 101 -apixml build/public_api.xml 102 @build/src-list 103 </arguments> 104 </doclava> 105 </target> 106</project> 107