1 <!-- Main build configutaion for Shibboleth java components - Walter Hoehn 06/04/2002 -->
3 <project name="Shibboleth" default="dist-origin" 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="endorsed" value="${root}/endorsed/" />
17 <property name="distlibs" value="${root}/lib/" />
18 <property name="dist" value="${root}/dist/" />
19 <property name="docs" value="${root}/doc/" />
20 <property name="javadocs" value="${docs}/api/" />
22 <property name="year" value="2002"/>
23 <property name="copyright" value="Copyright © ${year} UCAID. All Rights Reserved."/>
26 <!-- Construct the CLASSPATH -->
27 <path id="build.path">
28 <pathelement path="${classpath}" />
29 <pathelement location="${build}" />
30 <fileset dir="${libdir}">
31 <include name="**/*.jar" />
33 <fileset dir="${buildlibs}">
34 <include name="**/*.jar" />
39 <!-- Prepare directory structure for project build-->
41 <mkdir dir="${build}" />
42 <mkdir dir="${dist}" />
46 <!-- This target should be run before checking code into the repository -->
47 <target name="pre-checkin" depends="compile, test-all, clean-all" />
50 <!-- Compile classes and move them to ${build} -->
51 <target name="compile" depends="init">
52 <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on">
53 <classpath refid="build.path" />
55 <copy todir="${build}/schemas">
56 <fileset dir="${src}/schemas"/>
58 <copy todir="${build}/conf">
59 <fileset dir="${src}/conf"/>
63 <target name="compile-tests" depends="compile">
64 <javac srcdir="${tests}" destdir="${build}" includes="**/*.java" debug="on">
65 <classpath refid="build.path" />
70 <!-- Generate API docs -->
71 <target name="javadocs">
72 <mkdir dir="${docs}" />
73 <mkdir dir="${javadocs}" />
74 <javadoc packagenames='edu.internet2.middleware.*'
75 sourcepath='${src}' destdir='${javadocs}'
76 author='true' version='true'
77 windowtitle='Shibboleth Java API' doctitle='Shibboleth Java API'
78 bottom='${copyright}'>
79 <classpath refid="build.path" />
83 <!-- Create various product distributions and move them to ${dist} -->
85 <target name="dist-all" depends="compile, test-all, package-all, clean-build" />
86 <target name="package-all">
87 <war warfile="${dist}/${distname}.war" webxml="${configroot}/all.xml" basedir="${approot}" update="no" />
90 <target name="dist-origin" depends="compile, test-origin, package-origin, clean-build" />
91 <target name="package-origin">
92 <war warfile="${dist}/${distname}.war" webxml="${configroot}/origin.xml" basedir="${approot}" update="no" />
95 <target name="dist-wayf" depends="compile, package-wayf, clean-build" />
96 <target name="package-wayf">
97 <war warfile="${dist}/${distname}-wayf.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no" />
100 <!-- Build utilities -->
101 <target name="build-util" depends="compile">
102 <jar jarfile="${distlibs}/shib-util.jar" basedir="${build}" />
106 <!-- Cleanup after the build, test, and distribution processes -->
107 <target name="clean" depends="clean-all" />
108 <target name="clean-all" depends="clean-build, clean-dist, clean-test, clean-javadocs, clean-util" />
109 <target name="clean-build">
110 <delete dir="${build}" />
112 <target name="clean-test">
114 <fileset dir="${root}">
115 <include name="**/TEST*.txt" />
119 <target name="clean-dist">
120 <delete dir="${dist}" />
122 <target name="clean-javadocs">
123 <delete dir="${javadocs}" />
125 <target name="clean-util">
127 <fileset dir="${buildlibs}">
128 <include name="shib-util.jar" />
133 <!-- Run automated tests on compiled code -->
134 <target name="test-all" depends="test-origin" />
135 <target name="test-origin" depends="compile-tests">
136 <junit printsummary="no" fork="yes" haltonfailure="yes" haltonerror="yes" dir="${root}">
137 <jvmarg value="-Djava.endorsed.dirs=${endorsed}" />
138 <classpath refid="build.path" />
139 <formatter type="plain" />
140 <test name="edu.internet2.middleware.shibboleth.aa.arp.ArpTests" />
141 <test name="edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverTests" />
145 <target name="genSecret" depends="compile">
146 <taskdef name="genSecret" classname="edu.internet2.middleware.shibboleth.utils.HandleRepositorySecretGenerator" classpathref="build.path"/>
147 <genSecret keyStorePath="${appconfig}/handle.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />
150 <target name="genSalt" depends="compile">
151 <taskdef name="genSalt" classname="edu.internet2.middleware.shibboleth.utils.HandleRepositorySecretGenerator" classpathref="build.path"/>
152 <genSalt keyStorePath="${appconfig}/persistent.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />