aaaaaaaaaaaaaaaaaaaaaaaaaaah!
[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}/src" />
9         <property name="approot" value="${root}/webApplication" />
10         <property name="configroot" value="${root}/webAppConfig" />
11         <property name="build" value="${approot}/WEB-INF/classes" />
12         <property name="libdir" value="${approot}/WEB-INF/lib" />
13         <property name="buildlibs" value="${root}/lib" />
14         <property name="dist" value="${root}/dist" />
15
16
17         <!-- Construct the CLASSPATH -->
18         <path id="build.path">
19                 <pathelement path="${classpath}" />
20                 <pathelement location="${build}" />
21                 <fileset dir="${libdir}">
22                         <include name="**/*.jar" />
23                 </fileset>
24                 <fileset dir="${buildlibs}">
25                         <include name="**/*.jar" />
26                 </fileset>
27         </path>
28
29
30         <!-- Prepare directory structure for project build-->
31         <target name="init">
32         <mkdir dir="${build}" />
33         <mkdir dir="${dist}" />
34         </target>
35
36
37         <!-- Compile classes and move them to ${build} -->
38         <target name="compile-all" depends="init">
39                 <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on">
40                         <exclude name="edu/internet2/middleware/shibboleth/aaLocal/**" />
41                         <exclude name="edu/internet2/middleware/shibboleth/hs-cmu/**" />
42                         <classpath refid="build.path" />
43                 </javac>
44                 <copy todir="${build}/schemas">
45                         <fileset dir="${src}/schemas"/>
46                 </copy>
47         </target>
48
49
50
51         <!-- Create various product distributions and move them to ${dist} -->
52         <target name="dist" depends="dist-all" />
53         <target name="dist-all" depends="compile-all, test-all, package-all, clean-build" />
54         <target name="package-all">
55                 <war warfile="${dist}/${distname}.war" webxml="${approot}/WEB-INF/web.xml" basedir="${approot}" update="no" />
56         </target>
57
58         <target name="dist-origin" depends="compile-all, test-origin, package-origin, clean-build" />
59         <target name="package-origin">
60                 <war warfile="${dist}/${distname}-origin.war" webxml="${configroot}/origin.xml" basedir="${approot}" update="no" />
61         </target>
62
63         <target name="dist-target" depends="compile-all, test-target, package-target, clean-build" />
64         <target name="package-target">
65                 <war warfile="${dist}/${distname}-target.war" webxml="${configroot}/target.xml" basedir="${approot}" update="no" />
66         </target>
67
68         <target name="dist-target-includeswayf" depends="compile-all, test-target, test-wayf, package-target-includeswayf, clean-build" />
69         <target name="package-target-includeswayf">
70                 <war warfile="${dist}/${distname}-target.war" webxml="${configroot}/target-includeswayf.xml" basedir="${approot}" update="no" />
71         </target>
72
73         <target name="dist-wayf" depends="compile-all, test-wayf, package-wayf, clean-build" />
74         <target name="package-wayf">
75                 <war warfile="${dist}/${distname}-wayf.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no" />
76         </target>
77
78
79         <!-- Cleanup after the build, test, and distribution processes -->
80         <target name="clean" depends="clean-all" />
81         <target name="clean-all" depends="clean-build, clean-dist, clean-test" />
82         <target name="clean-build">
83                 <delete dir="${build}" />
84         </target>
85         <target name="clean-test">
86                 <delete>
87                         <fileset dir="${root}">
88                                 <include name="**/TEST*.txt" />
89                         </fileset>
90                 </delete>
91         </target>
92         <target name="clean-dist">
93                 <delete dir="${dist}" />
94         </target>
95
96         
97         <!-- Run automated tests on compiled code -->
98         <target name="test-all" depends="test-origin, test-target, test-wayf" />
99         <target name="test-origin" depends="test-common" />
100         <target name="test-target" depends="test-common" />
101         <target name="test-wayf" depends="test-common" />
102         <target name="test-common" depends="compile-all">
103                 <junit printsummary="no" fork="no" haltonfailure="yes" haltonerror="no">
104                         <classpath refid="build.path" />
105                         <formatter type="plain" />
106                 <!--    <test name="edu.internet2.middleware.shibboleth.common.AQHTest" /> -->
107                 </junit>
108         </target>
109
110 </project>
111