aheritier 2004/05/18 14:16:04
Modified: ant/src/plugin-resources/templates build.jelly
Log:
- 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
Revision Changes Path
1.15 +26 -17 maven-plugins/ant/src/plugin-resources/templates/build.jelly
Index: build.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/ant/src/plugin-resources/templates/build.jelly,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- build.jelly 17 May 2004 22:30:28 -0000 1.14
+++ build.jelly 18 May 2004 21:16:04 -0000 1.15
@@ -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>
<!-- ================================================================== -->
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]