Backed out "common" targets.
[java-idp.git] / build.xml
1 <!-- Main build configutaion for Shibboleth java components - Walter Hoehn 06/04/2002 -->
2
3 <project name="Shibboleth" default="dist-all" basedir=".">
4
5         <!-- Set global properties for this build -->
6         <property name="distname" value="shibboleth" />
7         <property name="root" value="." />
8         <property name="src" value="${root}/source" />
9         <property name="approot" value="${root}/webApplication" />
10         <property name="build" value="${approot}/WEB-INF/classes" />
11         <property name="libdir" value="${approot}/WEB-INF/lib" />
12         <property name="buildlibs" value="${root}/buildlibs" />
13         <property name="dist" value="${root}/dist" />
14
15
16         <!-- Construct the CLASSPATH -->
17         <path id="build.path">
18                 <pathelement path="${classpath}" />
19                 <pathelement location="${build}" />
20                 <fileset dir="${libdir}">
21                         <include name="**/*.jar" />
22                 </fileset>
23                 <fileset dir="${buildlibs}">
24                         <include name="**/*.jar" />
25                 </fileset>
26         </path>
27
28
29         <!-- Prepare directory structure for project build-->
30         <target name="init">
31         <mkdir dir="${build}" />
32         <mkdir dir="${dist}" />
33         </target>
34
35
36         <!-- Compile classes and move them to ${build} -->
37         <target name="compile-all" depends="init">
38                 <javac srcdir="${src}" destdir="${build}" includes="**/*.java" excludes="edu/internet2/middleware/shibboleth/aaLocal/**" debug="on">
39                         <classpath refid="build.path" />
40                 </javac>
41                 <copy todir="${build}/schemas">
42                         <fileset dir="${src}/schemas"/>
43                 </copy>
44         </target>
45
46
47
48         <!-- Create various product distributions and move them to ${dist} -->
49         <target name="dist-all" depends="compile-all, package, clean-build" />
50         <target name="dist-origin" depends="compile-all, package, clean-build" />
51         <target name="dist-target" depends="compile-all, package, clean-build" />
52         <target name="dist-wayf" depends="compile-all, package, clean-build" />
53         <target name="package">
54                 <war warfile="${dist}/${distname}.war" webxml="${approot}/WEB-INF/web.xml" basedir="${approot}" update="no" />
55         </target>
56
57
58         <!-- Cleanup after the build, test, and distribution processes -->
59         <target name="clean-all" depends="clean-build, clean-dist, clean-test" />
60         <target name="clean-build">
61                 <delete dir="${build}" />
62         </target>
63         <target name="clean-test">
64                 <delete>
65                         <fileset dir="${root}">
66                                 <include name="**/TEST*.txt" />
67                         </fileset>
68                 </delete>
69         </target>
70         <target name="clean-dist">
71                 <delete dir="${dist}" />
72         </target>
73
74         
75         <!-- Run automated tests on compiled code -->
76         <target name="test-all" depends="test-common" />
77         <target name="test-common" depends="compile-all">
78                 <junit printsummary="no" fork="no" haltonfailure="yes" haltonerror="no">
79                         <classpath refid="build.path" />
80                         <formatter type="plain" />
81                         <test name="edu.internet2.middleware.shibboleth.common.AQHTest" />
82                 </junit>
83         </target>
84
85 </project>
86