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