Renamed origin build to shibboleth.war (consistent with docs).
[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="distlibs" value="${root}/lib" />
15     <property name="dist" value="${root}/dist" />
16     <property name="docs" value="${root}/docs" />
17     <property name="javadocs" value="${docs}/api" />
18
19     <property name="year" value="2002"/>
20     <property name="copyright" value="Copyright &#169; ${year} UCAID. All Rights Reserved."/>
21
22
23     <!-- Construct the CLASSPATH -->
24     <path id="build.path">
25         <pathelement path="${classpath}" />
26         <pathelement location="${build}" />
27         <fileset dir="${libdir}">
28             <include name="**/*.jar" />
29         </fileset>
30         <fileset dir="${buildlibs}">
31             <include name="**/*.jar" />
32         </fileset>
33     </path>
34
35
36     <!-- Prepare directory structure for project build-->
37     <target name="init">
38     <mkdir dir="${build}" />
39     <mkdir dir="${dist}" />
40     </target>
41
42
43     <!-- This target should be run before checking code into the repository -->
44     <target name="pre-checkin" depends="compile-all, test-all, clean-all" />
45
46
47     <!-- Compile classes and move them to ${build} -->
48     <target name="compile-all" depends="init">
49         <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on">
50             <classpath refid="build.path" />
51         </javac>
52         <copy todir="${build}/schemas">
53             <fileset dir="${src}/schemas"/>
54         </copy>
55     </target>
56
57
58         <!-- Generate API docs -->
59         <target name="javadocs">
60                 <mkdir dir="${docs}" />
61                 <mkdir dir="${javadocs}" />
62                 <javadoc packagenames='edu.internet2.middleware.*'
63                         sourcepath='${src}' destdir='${javadocs}'
64                         author='true' version='true'
65                         windowtitle='Shibboleth Java API' doctitle='Shibboleth Java API'
66                         bottom='${copyright}'>
67                 <classpath refid="build.path" />
68         </javadoc>
69         </target>
70
71     <!-- Create various product distributions and move them to ${dist} -->
72     <target name="dist" depends="dist-all" />
73     <target name="dist-all" depends="compile-all, test-all, package-all, clean-build" />
74     <target name="package-all">
75         <war warfile="${dist}/${distname}.war" webxml="${configroot}/all.xml" basedir="${approot}" update="no" />
76     </target>
77
78     <target name="dist-origin" depends="compile-all, test-origin, package-origin, clean-build" />
79     <target name="package-origin">
80         <war warfile="${dist}/${distname}.war" webxml="${configroot}/origin.xml" basedir="${approot}" update="no" />
81     </target>
82
83     <!-- Build utilities -->
84     <target name="build-util" depends="compile-all">
85         <jar jarfile="${distlibs}/shib-util.jar" basedir="${build}" />
86     </target>
87
88     <target name="dist-wayf" depends="compile-all, test-wayf, package-wayf, clean-build" />
89     <target name="package-wayf">
90         <war warfile="${dist}/${distname}-wayf.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no" />
91     </target>
92
93
94     <!-- Cleanup after the build, test, and distribution processes -->
95     <target name="clean" depends="clean-all" />
96     <target name="clean-all" depends="clean-build, clean-dist, clean-test, clean-javadocs, clean-util" />
97     <target name="clean-build">
98         <delete dir="${build}" />
99     </target>
100     <target name="clean-test">
101         <delete>
102             <fileset dir="${root}">
103                 <include name="**/TEST*.txt" />
104             </fileset>
105         </delete>
106     </target>
107     <target name="clean-dist">
108         <delete dir="${dist}" />
109     </target>
110         <target name="clean-javadocs">
111                 <delete dir="${javadocs}" />
112         </target>
113     <target name="clean-util">
114         <delete>
115             <fileset dir="${buildlibs}">
116                 <include name="shib-util.jar" />
117             </fileset>
118         </delete>
119     </target>
120
121     
122     <!-- Run automated tests on compiled code -->
123     <target name="test-all" depends="test-origin, test-wayf" />
124     <target name="test-origin" depends="test-common" />
125     <target name="test-wayf" depends="test-common" />
126     <target name="test-common" depends="compile-all">
127         <junit printsummary="no" fork="no" haltonfailure="yes" haltonerror="no">
128             <classpath refid="build.path" />
129             <formatter type="plain" />
130         <!-- <test name="edu.internet2.middleware.shibboleth.common.AQHTest" /> -->
131         </junit>
132     </target>
133
134 </project>