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