136 lines
4.7 KiB
XML
136 lines
4.7 KiB
XML
<project name="qdox" default="main">
|
|
|
|
<!-- user customisation -->
|
|
<property file="config.properties"/>
|
|
|
|
<property name="name" value="qdox"/>
|
|
<property name="yacc.exe" value="/usr/bin/byaccj"/>
|
|
|
|
<!-- <taskdef name="mockmaker" classname="mockmaker.AntTask">
|
|
|
|
<classpath>
|
|
<fileset dir="bootstrap"/>
|
|
</classpath>
|
|
</taskdef> -->
|
|
|
|
<target name="generate-check">
|
|
<uptodate property="generate.skip"
|
|
targetfile="build/java/com/thoughtworks/qdox/parser/impl/Parser.java" >
|
|
<srcfiles dir="src/grammar"/>
|
|
</uptodate>
|
|
|
|
</target>
|
|
|
|
<target name="generate" description="Perform code generation"
|
|
depends="generate-check" unless="generate.skip">
|
|
<!-- Generate Lexer -->
|
|
<echo>**** Generating Lexer ****</echo>
|
|
<mkdir dir="build/java/com/thoughtworks/qdox/parser/impl"/>
|
|
<!-- <java classpath="bootstrap/jflex.jar" classname="JFlex.Main" fork="yes"> -->
|
|
<java classpath="/usr/share/java/jflex.jar" classname="JFlex.Main" fork="yes">
|
|
<arg value="-d"/>
|
|
<arg value="build/java/com/thoughtworks/qdox/parser/impl"/>
|
|
|
|
<arg value="src/grammar/lexer.flex"/>
|
|
</java>
|
|
|
|
<!-- Generate Parser -->
|
|
<echo>**** Generating Parser ****</echo>
|
|
<exec executable="${yacc.exe}" dir="build">
|
|
<arg value="-Jnorun"/>
|
|
<arg value="-Jnoconstruct"/>
|
|
<arg value="-Jclass=Parser"/>
|
|
|
|
<arg value="-Jsemantic=Value"/>
|
|
<arg value="-Jpackage=com.thoughtworks.qdox.parser.impl"/>
|
|
<arg value="../src/grammar/parser.y"/>
|
|
</exec>
|
|
<move todir="build/java/com/thoughtworks/qdox/parser/impl" file="build/Parser.java"/>
|
|
|
|
<!-- Generate Mock Objects -->
|
|
<echo>**** Generating Mock Objects ****</echo>
|
|
<mkdir dir="build/test"/>
|
|
|
|
<!-- <mockmaker srcdir="src/java" destdir="build/test"/> -->
|
|
</target>
|
|
|
|
<target name="compile" depends="generate" description="Compile Java">
|
|
<mkdir dir="build/classes"/>
|
|
<depend srcdir="src/java;build/java"
|
|
destdir="build/classes" />
|
|
<javac srcdir="src/java;build/java"
|
|
destdir="build/classes"
|
|
debug="true"/>
|
|
</target>
|
|
|
|
<target name="test" depends="compile" description="Compile and run tests">
|
|
|
|
<mkdir dir="build/test-classes"/>
|
|
<mkdir dir="lib"/>
|
|
<depend srcdir="src/test;build/test"
|
|
destdir="build/test-classes">
|
|
<classpath id="test.build.classpath">
|
|
<fileset dir="lib"/>
|
|
<pathelement path="build/classes"/>
|
|
</classpath>
|
|
</depend>
|
|
<javac srcdir="src/test;build/test"
|
|
destdir="build/test-classes"
|
|
debug="true">
|
|
<classpath refid="test.build.classpath" />
|
|
|
|
</javac>
|
|
<java classname="junit.textui.TestRunner" fork="yes">
|
|
<classpath>
|
|
<fileset dir="lib"/>
|
|
<pathelement location="/usr/share/java/junit.jar"/>
|
|
<pathelement path="build/classes"/>
|
|
<pathelement path="build/test-classes"/>
|
|
</classpath>
|
|
<arg value="com.thoughtworks.qdox.FullTestSuite"/>
|
|
</java>
|
|
|
|
</target>
|
|
|
|
<target name="jar" depends="compile" description="Generate redistributable jar">
|
|
<mkdir dir="build/classes-dist"/>
|
|
<javac srcdir="src/java;build/java" destdir="build/classes-dist" debug="false" optimize="true" />
|
|
<jar jarfile="build/${name}.jar">
|
|
<fileset dir="build/classes-dist"/>
|
|
</jar>
|
|
<echo>Generated build/${name}.jar</echo>
|
|
|
|
</target>
|
|
|
|
<target name="javadoc" description="o Generate javadoc">
|
|
<mkdir dir="build/javadocdir">
|
|
</mkdir>
|
|
<tstamp>
|
|
<format pattern="2002-yyyy" property="year">
|
|
</format>
|
|
</tstamp>
|
|
<property name="copyright" value="Copyright &copy; ThoughtWorks, Inc. All Rights Reserved.">
|
|
</property>
|
|
<property name="title" value="QDox 1.5 API">
|
|
</property>
|
|
<javadoc use="true" private="true" destdir="build/javadocdir" author="true" version="true" sourcepath="src/java" packagenames="com.thoughtworks.qdox.*">
|
|
<classpath>
|
|
<fileset dir="build">
|
|
<include name="*.jar">
|
|
</include>
|
|
</fileset>
|
|
<pathelement location="${defaulttargetdir}/${final.name}.jar">
|
|
</pathelement>
|
|
</classpath>
|
|
</javadoc>
|
|
</target>
|
|
|
|
<target name="main" depends="jar,test" description="Build jar and run unit tests."/>
|
|
|
|
|
|
<target name="clean" description="Clean up built files">
|
|
<delete dir="build"/>
|
|
</target>
|
|
|
|
</project>
|