- replace "compile" dependency in "javadoc" target with "get-deps"

- add a path reference for libs
- run Junit only if present in ANT (display a warning otherwise)
- comment unused downloads of junit and ant jars


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115377 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2004-05-18 21:16:04 +00:00
parent 55e3994adc
commit 7a4e630158

View File

@ -57,6 +57,12 @@
<property name="distdir" value="dist"/>
<property name="javadocdir" value="dist/docs/api"/>
<property name="final.name" value="${maven.final.name}"/>
<path id="build.classpath">
<fileset dir="$${libdir}" >
<include name="**/*.jar"/>
</fileset>
</path>
<target
name="init"
@ -65,6 +71,8 @@
<condition property="noget">
<equals arg1="$${build.sysclasspath}" arg2="only"/>
</condition>
<!-- Test if JUNIT is present in ANT classpath -->
<available classname="junit.framework.Test" property="Junit.present"/>
</target>
<target
@ -84,11 +92,7 @@
<src>
<pathelement location="${srcDir}"/>
</src>
<classpath>
<fileset dir="$${libdir}">
<include name="*.jar"/>
</fileset>
</classpath>
<classpath refid="build.classpath" />
</javac>
</j:if>
@ -203,9 +207,11 @@
description="o Run the test cases">
<fail message="There were test failures."/>
</target>
<target
name="internal-test"
depends="compile-tests">
depends="junit-present,compile-tests"
if="Junit.present">
<j:if test="${unitTestSourcesPresent}">
<mkdir dir="$${testreportdir}"/>
<junit printSummary="yes"
@ -218,9 +224,7 @@
<formatter type="xml"/>
<formatter type="plain" usefile="false"/>
<classpath>
<fileset dir="$${libdir}">
<include name="*.jar"/>
</fileset>
<path refid="build.classpath" />
<pathelement path="$${testclassesdir}"/>
<pathelement path="$${classesdir}"/>
</classpath>
@ -246,6 +250,13 @@
</j:if>
</target>
<target
name="junit-present"
depends="compile-tests"
unless="Junit.present">
<echo>Junit isn't present in your $${ANT_HOME}/lib directory. Tests not done.</echo>
</target>
<target
name="compile-tests"
depends="compile">
@ -261,9 +272,7 @@
<pathelement location="${testSrcDir}"/>
</src>
<classpath>
<fileset dir="$${libdir}">
<include name="*.jar"/>
</fileset>
<path refid="build.classpath" />
<pathelement path="$${classesdir}"/>
</classpath>
</javac>
@ -309,7 +318,8 @@
<target
name="javadoc"
description="o Generate javadoc" depends="jar">
description="o Generate javadoc"
depends="get-deps">
<mkdir dir="$${javadocdir}"/>
@ -341,10 +351,7 @@
doctitle="${title}"
bottom="${copyright}">
<classpath>
<fileset dir="$${libdir}">
<include name="*.jar"/>
</fileset>
<pathelement location="$${defaulttargetdir}/$${final.name}.jar"/>
<path refid="build.classpath" />
</classpath>
</javadoc>
@ -364,6 +371,7 @@
ignoreerrors="true"
/></j:forEach>
<!-- force junit for tests -->
<!--
<get
src="${repo}/junit/jars/junit-3.8.1.jar"
dest="$${libdir}/junit-3.8.1.jar"
@ -379,6 +387,7 @@
dest="$${libdir}/ant-optional-1.5.jar"
usetimestamp="true"
ignoreerrors="true"/>
-->
</target>
<!-- ================================================================== -->