*** empty log message ***
[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     <property name="docs" value="${root}/docs" />
16     <property name="javadocs" value="${docs}/api" />
17
18     <property name="year" value="2002"/>
19     <property name="copyright" value="Copyright &#169; ${year} UCAID. All Rights Reserved."/>
20
21
22     <!-- Construct the CLASSPATH -->
23     <path id="build.path">
24         <pathelement path="${classpath}" />
25         <pathelement location="${build}" />
26         <fileset dir="${libdir}">
27             <include name="**/*.jar" />
28         </fileset>
29         <fileset dir="${buildlibs}">
30             <include name="**/*.jar" />
31         </fileset>
32     </path>
33
34
35     <!-- Prepare directory structure for project build-->
36     <target name="init">
37     <mkdir dir="${build}" />
38     <mkdir dir="${dist}" />
39     </target>
40
41
42     <!-- This target should be run before checking code into the repository -->
43     <target name="pre-checkin" depends="compile-all, test-all, clean-all" />
44
45
46     <!-- Compile classes and move them to ${build} -->
47     <target name="compile-all" depends="init">
48         <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on">
49             <exclude name="edu/internet2/middleware/shibboleth/hs-cmu/**" />
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="${approot}/WEB-INF/web.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}-origin.war" webxml="${configroot}/origin.xml" basedir="${approot}" update="no" />
81     </target>
82
83     <target name="dist-target" depends="compile-all, test-target, package-target, clean-build" />
84     <target name="package-target">
85         <war warfile="${dist}/${distname}-target.war" webxml="${configroot}/target.xml" basedir="${approot}" update="no" />
86     </target>
87
88     <target name="dist-target-includewayf" depends="compile-all, test-target, test-wayf, package-target-includewayf, clean-build" />
89     <target name="package-target-includewayf">
90         <war warfile="${dist}/${distname}-target.war" webxml="${configroot}/target-includewayf.xml" basedir="${approot}" update="no" />
91     </target>
92
93     <target name="dist-wayf" depends="compile-all, test-wayf, package-wayf, clean-build" />
94     <target name="package-wayf">
95         <war warfile="${dist}/${distname}-wayf.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no" />
96     </target>
97
98
99     <!-- Cleanup after the build, test, and distribution processes -->
100     <target name="clean" depends="clean-all" />
101     <target name="clean-all" depends="clean-build, clean-dist, clean-test, clean-javadocs" />
102     <target name="clean-build">
103         <delete dir="${build}" />
104     </target>
105     <target name="clean-test">
106         <delete>
107             <fileset dir="${root}">
108                 <include name="**/TEST*.txt" />
109             </fileset>
110         </delete>
111     </target>
112     <target name="clean-dist">
113         <delete dir="${dist}" />
114     </target>
115         <target name="clean-javadocs">
116                 <delete dir="${javadocs}" />
117         </target>
118
119     
120     <!-- Run automated tests on compiled code -->
121     <target name="test-all" depends="test-origin, test-target, test-wayf" />
122     <target name="test-origin" depends="test-common" />
123     <target name="test-target" depends="test-common" />
124     <target name="test-wayf" depends="test-common" />
125     <target name="test-common" depends="compile-all">
126         <junit printsummary="no" fork="no" haltonfailure="yes" haltonerror="no">
127             <classpath refid="build.path" />
128             <formatter type="plain" />
129         <!-- <test name="edu.internet2.middleware.shibboleth.common.AQHTest" /> -->
130         </junit>
131     </target>
132
133 </project>
134
135