1 <!-- Main build configutaion for Shibboleth java components - Walter Hoehn 06/04/2002 -->
3 <project name="Shibboleth" default="dist-all" basedir=".">
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="tests" value="${root}/tests/" />
10 <property name="approot" value="${root}/webApplication/" />
11 <property name="appconfig" value="${src}/conf/" />
12 <property name="configroot" value="${root}/webAppConfig/" />
13 <property name="build" value="${approot}/WEB-INF/classes/" />
14 <property name="libdir" value="${approot}/WEB-INF/lib/" />
15 <property name="buildlibs" value="${root}/lib/" />
16 <property name="distlibs" value="${root}/lib/" />
17 <property name="dist" value="${root}/dist/" />
18 <property name="docs" value="${root}/docs/" />
19 <property name="javadocs" value="${docs}/api/" />
21 <property name="year" value="2002"/>
22 <property name="copyright" value="Copyright © ${year} UCAID. All Rights Reserved."/>
25 <!-- Construct the CLASSPATH -->
26 <path id="build.path">
27 <pathelement path="${classpath}" />
28 <pathelement location="${build}" />
29 <fileset dir="${libdir}">
30 <include name="**/*.jar" />
32 <fileset dir="${buildlibs}">
33 <include name="**/*.jar" />
38 <!-- Prepare directory structure for project build-->
40 <mkdir dir="${build}" />
41 <mkdir dir="${dist}" />
45 <!-- This target should be run before checking code into the repository -->
46 <target name="pre-checkin" depends="compile, test-all, clean-all" />
49 <!-- Compile classes and move them to ${build} -->
50 <target name="compile" depends="init">
51 <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on">
52 <classpath refid="build.path" />
54 <copy todir="${build}/schemas">
55 <fileset dir="${src}/schemas"/>
57 <copy todir="${build}/conf">
58 <fileset dir="${src}/conf"/>
62 <target name="compile-tests" depends="compile">
63 <javac srcdir="${tests}" destdir="${build}" includes="**/*.java" debug="on">
64 <classpath refid="build.path" />
69 <!-- Generate API docs -->
70 <target name="javadocs">
71 <mkdir dir="${docs}" />
72 <mkdir dir="${javadocs}" />
73 <javadoc packagenames='edu.internet2.middleware.*'
74 sourcepath='${src}' destdir='${javadocs}'
75 author='true' version='true'
76 windowtitle='Shibboleth Java API' doctitle='Shibboleth Java API'
77 bottom='${copyright}'>
78 <classpath refid="build.path" />
82 <!-- Create various product distributions and move them to ${dist} -->
83 <target name="dist" depends="dist-all" />
84 <target name="dist-all" depends="compile, test-all, package-all, clean-build" />
85 <target name="package-all">
86 <war warfile="${dist}/${distname}.war" webxml="${configroot}/all.xml" basedir="${approot}" update="no" />
89 <target name="dist-origin" depends="compile, test-origin, package-origin, clean-build" />
90 <target name="package-origin">
91 <war warfile="${dist}/${distname}.war" webxml="${configroot}/origin.xml" basedir="${approot}" update="no" />
94 <!-- Build utilities -->
95 <target name="build-util" depends="compile">
96 <jar jarfile="${distlibs}/shib-util.jar" basedir="${build}" />
99 <target name="dist-wayf" depends="compile, test-wayf, package-wayf, clean-build" />
100 <target name="package-wayf">
101 <war warfile="${dist}/${distname}-wayf.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no" />
105 <!-- Cleanup after the build, test, and distribution processes -->
106 <target name="clean" depends="clean-all" />
107 <target name="clean-all" depends="clean-build, clean-dist, clean-test, clean-javadocs, clean-util" />
108 <target name="clean-build">
109 <delete dir="${build}" />
111 <target name="clean-test">
113 <fileset dir="${root}">
114 <include name="**/TEST*.txt" />
118 <target name="clean-dist">
119 <delete dir="${dist}" />
121 <target name="clean-javadocs">
122 <delete dir="${javadocs}" />
124 <target name="clean-util">
126 <fileset dir="${buildlibs}">
127 <include name="shib-util.jar" />
132 <!-- Run automated tests on compiled code -->
133 <target name="test-all" depends="test-origin, test-wayf" />
134 <target name="test-origin" depends="test-common">
135 <junit printsummary="no" fork="yes" haltonfailure="yes" haltonerror="yes" dir="${root}">
136 <classpath refid="build.path" />
137 <formatter type="plain" />
138 <test name="edu.internet2.middleware.shibboleth.aa.arp.ArpTests" />
141 <target name="test-wayf" depends="test-common" />
142 <target name="test-common" depends="compile-tests"/>
144 <target name="genSecret" depends="compile">
145 <taskdef name="genSecret" classname="edu.internet2.middleware.shibboleth.utils.HandleRepositorySecretGenerator" classpathref="build.path"/>
146 <genSecret keyStorePath="${appconfig}/handle.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />