108 lines
5.3 KiB
XML
108 lines
5.3 KiB
XML
<project name="qdox" default="jar" basedir=".">
|
|
<property name="qdox.version" value="@VERSION@"/>
|
|
<property name="maven.build.output" value="target/classes"/>
|
|
<property name="maven.build.directory" value="target"/>
|
|
<property name="maven.build.final.name" value="qdox-${qdox.version}"/>
|
|
<property name="maven.test.reports" value="${maven.build.directory}/test-reports"/>
|
|
<property name="maven.test.output" value="target/test-classes"/>
|
|
<property name="maven.pom.dir" value="."/>
|
|
<property name="javadocdir" value="target/site/apidocs"></property>
|
|
<target name="clean" description="Clean the output directory">
|
|
<delete dir="${maven.build.directory}"/>
|
|
</target>
|
|
<target name="compile" description="Compile the code">
|
|
<mkdir dir="${maven.build.output}"/>
|
|
<javac destdir="${maven.build.output}" excludes="**/package.html" debug="true" deprecation="true" optimize="false">
|
|
<src>
|
|
<pathelement location="src/java"/>
|
|
</src>
|
|
</javac>
|
|
</target>
|
|
<target name="jar" depends="compile,test" description="Clean the JAR">
|
|
<tstamp>
|
|
<format property="tstamp" pattern="E M d HH:mm:ss yyyy" />
|
|
</tstamp>
|
|
<mkdir dir="${maven.build.output}/META-INF/maven/com.thoughtworks.qdox/qdox/"/>
|
|
<copy file="${maven.pom.dir}/pom.xml"
|
|
todir="${maven.build.output}/META-INF/maven/com.thoughtworks.qdox/qdox"/>
|
|
<echo message="#${tstamp} " file="${maven.build.output}/META-INF/maven/com.thoughtworks.qdox/qdox/pom.properties" append="false"/>
|
|
<echo message="version=${qdox.version} " file="${maven.build.output}/META-INF/maven/com.thoughtworks.qdox/qdox/pom.properties" append="true"/>
|
|
<echo message="groupId=com.thoughtworks.qdox " file="${maven.build.output}/META-INF/maven/com.thoughtworks.qdox/qdox/pom.properties" append="true"/>
|
|
<echo message="artifactId=qdox" file="${maven.build.output}/META-INF/maven/com.thoughtworks.qdox/qdox/pom.properties" append="true"/>
|
|
<jar jarfile="${maven.build.directory}/${maven.build.final.name}.jar"
|
|
compress="true"
|
|
index="false"
|
|
basedir="${maven.build.output}"
|
|
excludes="**/package.html">
|
|
<manifest>
|
|
<attribute name="Built-By" value="${user.name}"/>
|
|
<attribute name="Package" value="com.thoughtworks.qdox"/>
|
|
<attribute name="Build-Jdk" value="${java.version}"/>
|
|
<attribute name="Extension-Name" value="qdox"/>
|
|
<attribute name="Specification-Title" value="QDox - Quick JavaDoc Scanner"/>
|
|
<attribute name="Specification-Vendor" value="ThoughtWorks, Inc"/>
|
|
<attribute name="Implementation-Title" value="com.thoughtworks.qdox"/>
|
|
<attribute name="Implementation-Vendor" value="ThoughtWorks, Inc"/>
|
|
<attribute name="Implementation-Version" value="${qdox.version}"/>
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
<target name="compile-tests" depends="junit-present, compile" description="Compile the test code" if="junit.present">
|
|
<mkdir dir="${maven.test.output}"/>
|
|
<javac destdir="${maven.test.output}" excludes="**/package.html" debug="true" deprecation="true" optimize="false">
|
|
<src>
|
|
<pathelement location="src/test"/>
|
|
</src>
|
|
<classpath>
|
|
<path refid="build.classpath"/>
|
|
<pathelement location="${maven.build.output}"/>
|
|
</classpath>
|
|
</javac>
|
|
</target>
|
|
<target name="test" depends="junit-present, compile-tests" if="junit.present" description="Run the test cases">
|
|
<mkdir dir="${maven.test.reports}"/>
|
|
<junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
|
|
<sysproperty key="basedir" value="."/>
|
|
<formatter type="xml"/>
|
|
<formatter type="plain" usefile="false"/>
|
|
<classpath>
|
|
<path refid="build.classpath"/>
|
|
<pathelement location="${maven.build.output}"/>
|
|
<pathelement location="${maven.test.output}"/>
|
|
</classpath>
|
|
<batchtest todir="${maven.test.reports}">
|
|
<fileset dir="src/test">
|
|
<include name="**/*Test.java"/>
|
|
<exclude name="**/*Abstract*Test.java"/>
|
|
</fileset>
|
|
</batchtest>
|
|
</junit>
|
|
</target>
|
|
<target name="test-junit-present">
|
|
<available classname="junit.framework.Test" property="junit.present"/>
|
|
</target>
|
|
<target name="junit-present" depends="test-junit-present" unless="junit.present">
|
|
<echo>================================= WARNING ================================</echo>
|
|
<echo> Junit isn't present in your $ANT_HOME/lib directory. Tests not executed. </echo>
|
|
<echo>==========================================================================</echo>
|
|
</target>
|
|
<target name="test-offline">
|
|
<condition property="maven.mode.offline">
|
|
<equals arg1="${build.sysclasspath}" arg2="only"/>
|
|
</condition>
|
|
</target>
|
|
<target name="javadoc" description="o Generate javadoc" >
|
|
<mkdir dir="${javadocdir}"></mkdir>
|
|
<tstamp>
|
|
<format pattern="-yyyy" property="year"></format>
|
|
</tstamp>
|
|
<property name="copyright" value="Copyright &copy; . All Rights Reserved."></property>
|
|
<property name="title" value="QDox ${qdox.version} API"></property>
|
|
<javadoc use="true" private="true" destdir="${javadocdir}" author="true" version="true" sourcepath="src/java" packagenames="com.thoughtworks.qdox.*">
|
|
<classpath>
|
|
<path refid="build.classpath"></path>
|
|
</classpath>
|
|
</javadoc>
|
|
</target>
|
|
</project>
|