1 <project name="JSilver" default="jar"> 2 <property name="jar.dir" value="build/dist" /> 3 <property name="jar.file" value="${jar.dir}/jsilver.jar"/> 4 5 <property name="src" value="src" /> 6 <property name="gen" value="build/gen" /> 7 8 <property name="lib.guava" value="lib/guava-r06.jar" /> 9 10 <target name="gen" description="Code generation" > 11 <mkdir dir="${gen}" /> 12 <exec executable="java"> 13 <arg value="-jar" /> 14 <arg value="sablecc/sablecc.jar" /> 15 <arg value="src/com/google/clearsilver/jsilver/syntax/jsilver.sablecc" /> 16 <arg value="-d" /> 17 <arg value="${gen}" /> 18 </exec> 19 20 <copy file="sablecc/optimizations/AOptimizedMultipleCommand.java" 21 todir="${gen}/com/google/clearsilver/jsilver/syntax/node" /> 22 </target> 23 24 <target name="compile" description="Compile Java source." depends="gen"> 25 <mkdir dir="build/classes"/> 26 27 <javac srcdir="${src}:${gen}" 28 debug="on" 29 destdir="build/classes" 30 source="1.5" 31 target="1.5" 32 extdirs="" 33 > 34 <compilerarg value="-Xlint:all"/> 35 <classpath> 36 <fileset dir="lib/"> 37 <include name="*.jar"/> 38 </fileset> 39 </classpath> 40 <exclude name="com/google/clearsilver/jsilver/benchmark/*.java"/> 41 </javac> 42 </target> 43 44 <target name="jar" depends="compile" description="Build jar."> 45 <mkdir dir="${jar.dir}"/> 46 <jar jarfile="${jar.file}"> 47 <fileset dir="build/classes"/> 48 <zipfileset src="${lib.guava}" /> 49 <fileset dir="${gen}"> 50 <include name="**/*.dat"/> 51 </fileset> 52 </jar> 53 </target> 54 55 <target name="clean" 56 description="Remove generated files."> 57 <delete dir="build" /> 58 </target> 59 60 </project> 61