Was miscomputing the Accept attribute in various rules.
[java-idp.git] / build.xml
1 <!-- Main build configutaion for Shibboleth java components - Walter Hoehn 06/04/2002 -->
2
3 <project name="Shibboleth" default="install" basedir=".">
4
5         <!-- Set global properties for this build -->
6         <property name="distnameWayf" value="shibboleth-wayf" />
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="custom" value="${root}/custom/" />
19         <property name="custom.libs" value="${custom}/lib"/>
20         <property name="custom.webapges" value="${custom}/web"/>
21         <property name="dist" value="${root}/dist/" />
22         <property name="docs" value="${root}/doc/" />
23         <property name="javadocs" value="${docs}/api/" />
24
25         <property name="year" value="2002-2005"/>
26         <property name="copyright" value="Copyright &#169; ${year} UCAID. All Rights Reserved."/>
27
28
29         <!-- antcontrib tasks -->
30         <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildlibs}/ant-contrib.jar"/>
31
32         <!-- Import the tasks for building custom extensions -->
33         <import file="${custom}/extension-build.xml"/>
34
35         <!-- Construct the CLASSPATH -->
36         <path id="build.path">
37                 <pathelement location="${build}" />
38                 <fileset dir="${endorsed}">
39                         <include name="**/*.jar" />
40                 </fileset>
41                 <fileset dir="${libdir}">
42                         <include name="**/*.jar" />
43                 </fileset>
44                 <fileset dir="${buildlibs}">
45                         <include name="**/*.jar" />
46                 </fileset>
47         </path>
48
49
50         <!-- Prepare directory structure for project build-->
51         <target name="init">
52                 <mkdir dir="${build}" />
53                 <mkdir dir="${dist}" />
54                 <mkdir dir="${custom.libs}"/>
55                 <mkdir dir="${custom.webapges}"/>
56
57                 <if>
58                         <not> <available file="build.properties" /> </not>
59                         <then>
60                                 <copy file="conf/default.build.properties" tofile="build.properties" />
61                         </then>
62                 </if>
63
64                 <property file="build.properties" />
65         </target>
66
67
68         <!-- This target should be run before checking code into the repository -->
69         <target name="pre-checkin" depends="compile, test-all, clean-all" />
70
71
72         <!-- Compile classes and move them to ${build} -->
73         <target name="compile" depends="init"
74                 description="Compile source files">
75                 <!-- Compile the shib code into the build path -->
76                 <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on" source="1.4">
77                         <classpath refid="build.path" />
78                 </javac>
79                 <!-- Copy xml schemas to the build path -->
80                 <copy todir="${build}/schemas">
81                         <fileset dir="${src}/schemas"/>
82                 </copy>
83
84                 <!-- Build extensions -->
85                 <antcall target="ext-invoke">
86                         <param name="exts.dir" value="${custom}"/>
87             <param name="ext.build.function" value="ext-build"/>      
88                 </antcall>
89         </target>
90
91
92         <!-- Generate API docs -->
93         <target name="javadocs">
94                 <mkdir dir="${docs}" />
95                 <mkdir dir="${javadocs}" />
96                 <javadoc packagenames='edu.internet2.middleware.*'
97                         sourcepath='${src}' destdir='${javadocs}'
98                         author='true' version='true'
99                         windowtitle='Shibboleth Java API' doctitle='Shibboleth Java API'
100                         bottom='${copyright}'>
101                         <classpath refid="build.path" />
102                 </javadoc>
103         </target>
104
105
106         <!-- Build command-line utilities -->
107         <target name="build-util" depends="compile">
108                 <jar jarfile="${distlibs}/shib-util.jar" basedir="${build}" />
109         </target>
110
111         <!-- Cleanup after the build, test, and distribution processes -->
112         <target name="clean" depends="clean-all" />
113
114     <target name="clean-all" depends="clean-build, clean-dist, clean-test, clean-javadocs, clean-util"/>
115         
116     <target name="clean-build">
117                 <delete dir="${build}" />
118                 <delete dir="${custom.libs}"/>
119                 <delete dir="${custom.webapges}"/>
120             <antcall target="ext-invoke">
121                 <param name="exts.dir" value="${custom}"/>
122             <param name="ext.build.function" value="ext-clean-build"/>   
123             </antcall>
124         </target>
125         
126     <target name="clean-test">
127                 <delete>
128                         <fileset dir="${root}">
129                                 <include name="**/TEST*.txt" />
130                         </fileset>
131                 </delete>
132         </target>
133         
134     <target name="clean-dist">
135                 <delete dir="${dist}" />
136         <antcall target="ext-invoke">
137             <param name="exts.dir" value="${custom}"/>
138             <param name="ext.build.function" value="ext-clean-dist"/>   
139         </antcall>   
140         </target>
141         
142     <target name="clean-javadocs">
143                 <delete dir="${javadocs}" />
144         <antcall target="ext-invoke">
145             <param name="exts.dir" value="${custom}"/>
146             <param name="ext.build.function" value="ext-clean-javadocs"/>   
147         </antcall>
148         </target>
149         
150     <target name="clean-util">
151                 <delete>
152                         <fileset dir="${buildlibs}">
153                                 <include name="shib-util.jar" />
154                         </fileset>
155                 </delete>
156         </target>
157
158         <!-- Add to the classpath for unit tests -->
159         <path id="test.path">
160                 <path refid="build.path"/>
161                 <pathelement location="${tests}"/>
162         </path>
163
164         <!-- Compile classes needed for unit testing -->
165         <target name="compile-tests" depends="compile">
166                 <javac srcdir="${tests}" destdir="${build}" includes="**/*.java" debug="on" source="1.4">
167                         <classpath refid="build.path" />
168                 </javac>
169         </target>
170
171         <!-- Run automated tests on compiled code -->
172         <target name="test-all" depends="test-IdP, test-SP" />
173
174         <target name="test-IdP" depends="compile-tests">
175                 <junit printsummary="no" fork="yes" haltonfailure="yes" haltonerror="yes" dir="${root}">
176                         <jvmarg value="-Djava.endorsed.dirs=${endorsed}" />
177                         <classpath>
178                             <fileset dir="${custom.libs}">
179                                 <include name="*.jar"/>
180                             </fileset>
181                             <path refid="test.path"/>
182                         </classpath>
183                         <formatter type="plain" />
184                         <test name="edu.internet2.middleware.shibboleth.aa.arp.ArpTests" />
185                         <test name="edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverTests" />
186                         <test name="edu.internet2.middleware.shibboleth.common.CredentialsTests" />
187                         <test name="edu.internet2.middleware.shibboleth.common.provider.NameMapperTests" />
188                         <test name="edu.internet2.middleware.shibboleth.common.TrustTests" />
189                         <test name="edu.internet2.middleware.shibboleth.idp.provider.DNHostNameExtractionTests" />
190                         <test name="edu.internet2.middleware.shibboleth.metadata.MetadataTests" />
191                 </junit>
192         </target>
193
194         <target name="test-SP" depends="compile-tests">
195                 <junit printsummary="no" fork="yes" haltonfailure="yes" haltonerror="yes" dir="${root}">
196                         <jvmarg value="-Djava.endorsed.dirs=${endorsed}" />
197                     <classpath>
198                                 <fileset dir="${custom.libs}">
199                                         <include name="*.jar"/>
200                                 </fileset>
201                         <path refid="test.path"/>
202                         </classpath>
203                         <formatter type="plain" />
204                         <test name="edu.internet2.middleware.shibboleth.aap.AAPTests" />
205                 </junit>
206         </target>
207
208
209         <!-- Tomcat Management -->
210         <target name="setupTomcatTasks" depends="init">
211                 <path id="tomcat.classpath">
212                         <fileset dir="${tomcat.home}/server/lib" includes="catalina-ant.jar"/>
213                 </path>
214
215                 <taskdef name="tomcatStart" classname="org.apache.catalina.ant.StartTask" classpathref="tomcat.classpath"/>
216                 <taskdef name="tomcatStop" classname="org.apache.catalina.ant.StopTask" classpathref="tomcat.classpath"/>
217                 <taskdef name="tomcatDeploy" classname="org.apache.catalina.ant.DeployTask" classpathref="tomcat.classpath"/>
218                 <taskdef name="tomcatUndeploy" classname="org.apache.catalina.ant.UndeployTask" classpathref="tomcat.classpath"/>
219         </target>
220
221         <target name="tomcat.start" depends="setupTomcatTasks" description="Start a deployed webapp using Tomcat manager">
222                 <tomcatStart url="${tomcat.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${idp.webapp.name}"/>
223         </target>
224
225         <target name="tomcat.stop" depends="setupTomcatTasks" description="Stop a deployed webapp using Tomcat manager">
226                 <tomcatStop url="${tomcat.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${idp.webapp.name}"/>
227         </target>
228
229         <target name="tomcat.deploy" depends="setupTomcatTasks" description="Upload and deploy using Tomcat manager">
230                 <tomcatDeploy url="${tomcat.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${idp.webapp.name}"
231                         war="file:${basedir}/${dist}/${idp.webapp.name}.war"/>
232         </target>
233
234         <target name="tomcat.undeploy" depends="setupTomcatTasks" description="Undeploy using Tomcat manager">
235                 <tomcatUndeploy url="${tomcat.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${idp.webapp.name}"/>
236         </target>
237
238
239         <!-- Automated key generation for crypto handles -->
240         <target name="genSecret" depends="compile">
241                 <taskdef name="genSecret" classname="edu.internet2.middleware.shibboleth.utils.HandleRepositorySecretGenerator" classpathref="build.path"/>
242                 <genSecret keyStorePath="${appconfig}/handle.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />
243         </target>
244
245
246         <!-- Generate salt for use with targetted id -->
247         <target name="genSalt" depends="compile">
248                 <taskdef name="genSalt" classname="edu.internet2.middleware.shibboleth.utils.HandleRepositorySecretGenerator" classpathref="build.path"/>
249                 <genSalt keyStorePath="${appconfig}/persistent.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />
250         </target>
251
252         <target name="exampleCertificates">
253                 <!--
254                 This target provides an example of the generation of
255                 self-signed Certificates for the IdP and SP. You may
256                 change the cn= and use it to generate new identities
257                 when you want to replace "example.org" with your real
258                 organization dns. However,the generated key and 
259                 certificate also have to be defined to the Credentials
260                 of the IdP and SP config files and added to the Metadata.
261                 -->
262                 <genkey alias="tomcat" storepass="exampleorg"
263                         keystore="${tomcat.home}/conf/idp-example.jks"
264                         keyalg="RSA" validity="365"
265                         dname="cn=idp.example.org, o=example.org, c=US"
266                         />
267                 <genkey alias="tomcat" storepass="exampleorg"
268                         keystore="${tomcat.home}/conf/sp-example.jks"
269                         keyalg="RSA" validity="365"
270                         dname="cn=sp.example.org, o=example.org, c=US"
271                         />
272         </target>
273
274
275         <!-- Package Shibboleth -->
276         <target name="package-idp" depends="compile, install.url" description="Creates the IdP war file and moves it to ${dist}">
277                 <!-- copy values to deployment descriptor -->
278                 <copy file="${configroot}/${idp.deployment.descriptor}" tofile="${configroot}/idp.xml" overwrite="true" />
279                 <replace file="${configroot}/idp.xml" token="$IDP_HOME$" value="${idp.home.url}" />
280      
281         <!-- package extensions -->
282         <antcall target="ext-invoke">
283             <param name="exts.dir" value="${custom}"/>
284             <param name="ext.build.function" value="ext-package"/>
285             <param name="ext.filesystem.home" value="${idp.home}"/>
286             <param name="ext.home.token" value="$IDP_HOME$"/>
287         </antcall>
288
289                 <!-- create the war -->
290                 <war warfile="${dist}/${idp.webapp.name}.war" webxml="${configroot}/idp.xml" basedir="${approot}" update="no" duplicate="preserve">
291                         <!-- Grab any custom extension libraries -->
292                         <lib dir="${custom.libs}"/>
293
294                         <!-- Grab any web material from custom extensions -->
295                         <fileset dir="${custom.webapges}"/>
296                 </war>
297
298                 <!-- clean up generated descriptor -->
299                 <delete file="${configroot}/idp.xml"/>
300         </target>
301
302         <target name="package-wayf" depends="compile" description="Creates the WAYF war and moves it to ${dist}">
303         <copy file="${appconfig}/schemas.properties" todir="${approot}/WEB-INF/classes/conf"/>
304         <copy file="${appconfig}/wayfconfig.xml" todir="${approot}/WEB-INF/classes/conf"/>
305             
306                 <war warfile="${dist}/${distnameWayf}.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no"/>
307         </target>
308
309         <target name="package-sp" depends="compile, install.url" description="Creates the Java SP war and moves it to ${dist}">
310                 <!-- copy values to deployment descriptor -->
311                 <copy file="${configroot}/${sp.deployment.descriptor}" tofile="${configroot}/sp.xml" overwrite="true" />
312                 <replace file="${configroot}/sp.xml" token="$SP_HOME$" value="${sp.home.url}" />
313
314         <!-- package extensions -->
315         <antcall target="ext-invoke">
316             <param name="exts.dir" value="${custom}"/>
317             <param name="ext.build.function" value="ext-package"/>
318             <param name="ext.filesystem.home" value="${sp.home}"/>
319             <param name="ext.home.token" value="$SP_HOME$"/>
320         </antcall>
321         
322                 <!-- create the war -->
323                 <war warfile="${dist}/${sp.webapp.name}.war" webxml="${configroot}/sp.xml" basedir="${approot}" update="no">
324                         <!-- Grab any custom extension libraries -->
325                         <lib dir="${custom.libs}"/>
326
327                         <!-- Grab any web material from custom extensions -->
328                         <fileset dir="${custom.webapges}"/>
329                 </war>
330
331                 <!-- clean up generated descriptor -->
332                 <delete file="${configroot}/sp.xml"/>
333         </target>
334
335
336         <!-- Install Shibboleth -->
337         <target name="install.init">
338                 <taskdef name="xinput" classname="edu.internet2.middleware.shibboleth.utils.ant.XInput" classpath="${build}" />
339                 <typedef name="xoption" classname="edu.internet2.middleware.shibboleth.utils.ant.XInputOption" classpath="${build}" />
340         </target>
341
342         <target name="install.url">
343                 <taskdef name="urlconvert" classname="edu.internet2.middleware.shibboleth.utils.ant.URLConvert" classpath="${build}"/>
344                 <urlconvert path="${idp.home}" addProperty="idp.home.url"/>
345                 <urlconvert path="${sp.home}" addProperty="sp.home.url"/>
346         </target>
347
348         <target name="install" depends="init, install.init" description="Install Shibboleth">
349                 <if>
350                         <xinput type="confirm" defaultvalue="y">Do you want to install the Shibboleth Identity Provider?</xinput>
351                         <then>
352                                 <input message="What name do you want to use for the Identity Provider web application? [default: ${idp.webapp.name}]" 
353                                         addproperty="idp.webapp.name.input" defaultValue="${idp.webapp.name}" />
354                                 <var name="idp.webapp.name" value="${idp.webapp.name.input}" />
355
356                                 <antcall target="install.idp" />
357                         </then>
358                 </if>
359         </target>
360         
361         <target name="installx" depends="init, install.init" description="Interactive SP Install">
362                 <if>
363                         <xinput type="confirm" defaultvalue="y">Do you want to install the Shibboleth Service Provider?</xinput>
364                         <then>
365                                 <input message="What name do you want to use for the Service Provider web application? [default: ${sp.webapp.name}]" 
366                                         addproperty="sp.webapp.name.input" defaultValue="${sp.webapp.name}" />
367                                 <var name="sp.webapp.name" value="${sp.webapp.name.input}" />
368
369                                 <antcall target="install.sp" />
370                         </then>
371                 </if>
372         </target>
373
374         <target name="install.idp" depends="init, install.init">
375                 <xinput message="Deploying the java web application.  Do you want to install it directly onto the filesystem or use the tomcat manager application?" 
376                         addproperty="idp.install-type.input" type="menu" casesensitive="no" defaultValue="${idp.install-type}">
377                         <xoption value="filesystem.prompt">filesystem</xoption>
378                         <xoption>manager</xoption>
379                 </xinput>
380                 <var name="idp.install-type" value="${idp.install-type.input}" />
381
382                 <antcall target="install.idp.${idp.install-type}" />
383         </target>
384         
385         <target name="install.sp" depends="init, install.init">
386                 <xinput message="Deploying the java web application.  Do you want to install it directly onto the filesystem or use the tomcat manager application?" 
387                         addproperty="sp.install-type.input" type="menu" casesensitive="no" defaultValue="${sp.install-type}">
388                         <xoption value="filesystem.prompt">filesystem</xoption>
389                         <xoption>manager</xoption>
390                 </xinput>
391                 <var name="sp.install-type" value="${sp.install-type.input}" />
392
393                 <antcall target="install.sp.${sp.install-type}" />
394         </target>
395
396         <!-- Prompt user for filesystem installation options and save them to build.properties -->
397         <target name="install.idp.filesystem.prompt" depends="init, install.init">
398                 <input message="Select a home directory for the Shibboleth Identity Provider [default: ${idp.home}]"
399                         addproperty="idp.home.input" defaultvalue="${idp.home}" />
400                 <var name="idp.home" value="${idp.home.input}" />
401                 <input message="Enter tomcat home directory [default: ${tomcat.home}]"
402                         addproperty="tomcat.home.input" defaultvalue="${tomcat.home}" />
403                 <var name="tomcat.home" value="${tomcat.home.input}" />
404
405                 <if>
406                         <available file="${idp.home}/etc" />
407                         <then>
408                                 <echo>--------------------------------------------------------------------------------------</echo>
409                                 <echo>---</echo>
410                                 <echo>---   NOTE:  Existing Identiity Provider configuration at ${idp.home}/etc ${line.separator}---   will not be overwritten.</echo>
411                                 <echo>---</echo>
412                                 <echo>--------------------------------------------------------------------------------------</echo>
413                                 <property name="copy-idp-conf" value="n" />
414                         </then>
415                         <else>
416                                 <property name="copy-idp-conf" value="y" />
417                         </else>
418                 </if>
419
420                 <antcall target="install.idp.filesystem" />
421                 <antcall target="savePropertyFile" />
422         </target>
423         
424         <!-- Prompt user for filesystem installation options and save them to build.properties -->
425         <target name="install.sp.filesystem.prompt" depends="init, install.init">
426                 <input message="Select a home directory for the Shibboleth Service Provider [default: ${sp.home}]"
427                         addproperty="sp.home.input" defaultvalue="${sp.home}" />
428                 <var name="sp.home" value="${sp.home.input}" />
429                 <input message="Enter tomcat home directory [default: ${tomcat.home}]"
430                         addproperty="tomcat.home.input" defaultvalue="${tomcat.home}" />
431                 <var name="tomcat.home" value="${tomcat.home.input}" />
432
433                 <if>
434                         <available file="${sp.home}/etc" />
435                         <then>
436                                 <echo>--------------------------------------------------------------------------------------</echo>
437                                 <echo>---</echo>
438                                 <echo>---   NOTE:  Existing Service Provider configuration at ${sp.home}/etc ${line.separator}---   will not be overwritten.</echo>
439                                 <echo>---</echo>
440                                 <echo>--------------------------------------------------------------------------------------</echo>
441                                 <property name="copy-sp-conf" value="n" />
442                         </then>
443                         <else>
444                                 <property name="copy-sp-conf" value="y" />
445                         </else>
446                 </if>
447
448                 <antcall target="install.sp.filesystem" />
449                 <antcall target="savePropertyFile" />
450         </target>
451
452         <!-- Install Shibboleth IdP to filesystem using the properties in build.properties -->
453         <target name="install.idp.filesystem" depends="init, install.init, build-util, install.url, package-idp" 
454                 description="Install Shibboleth IdP to filesystem using the properties in build.properties">
455
456                 <!-- Move IdP war to Tomcat deployment directory -->
457                 <copy file="${dist}/${idp.webapp.name}.war" tofile="${tomcat.home}/webapps/${idp.webapp.name}.war" />
458
459                 <!-- copy IdP jars and utilities -->
460                 <copy todir="${idp.home}/lib">
461                         <fileset dir="lib" includesfile="conf/idp-lib.include" />
462                 </copy>
463
464                 <copy todir="${idp.home}/endorsed">
465                         <fileset dir="endorsed" />
466                 </copy>
467
468                 <copy todir="${idp.home}/bin">
469                         <fileset dir="bin"/>
470                 </copy>
471                 <chmod dir="${idp.home}/bin" perm="ug+rx" includes="**/*"/>
472
473                 <mkdir dir="${idp.home}/logs" />
474
475                 <!-- copy IdP configuration -->
476                 <if>
477                         <or>
478                                 <equals arg1="${copy-idp-conf}" arg2="y" />
479                                 <not> <available file="${idp.home}/etc" /> </not>
480                         </or>
481                         <then>
482                                 <delete dir="${idp.home}/etc" />
483                                 <antcall target="install.idp.filesystem.config" />
484                         </then>
485                 </if>
486
487         <antcall target="ext-invoke">
488             <param name="exts.dir" value="${custom}"/>
489             <param name="ext.build.function" value="ext-install-filesystem"/>
490             <param name="ext.filesystem.home" value="${idp.home}"/>
491             <param name="ext.home.token" value="$IDP_HOME$"/>
492         </antcall>   
493         </target>
494
495         <!-- Install Shibboleth SP to filesystem using the properties in build.properties -->
496         <target name="install.sp.filesystem" depends="init, install.init, build-util, install.url, package-sp" 
497                 description="Install Shibboleth SP to filesystem using the properties in build.properties">
498
499                 <!-- Move SP war to Tomcat deployment directory -->
500                 <copy file="${dist}/${sp.webapp.name}.war" tofile="${tomcat.home}/webapps/${sp.webapp.name}.war" />
501                 
502                 <!-- Move Shib Filter jar to Tomcat shared directory -->
503                 <copy file="${distlibs}/shib-filter.jar" tofile="${tomcat.home}/shared/lib/shib-filter.jar" />
504                 
505                 <!-- Copy test secure application to Tomcat -->
506                 <copy file="${root}/data/secure.war" tofile="${tomcat.home}/webapps/secure.war" />
507
508                 <!-- copy sp jars and utilities -->
509                 <copy todir="${sp.home}/lib">
510                         <fileset dir="lib" includesfile="conf/idp-lib.include" />
511                 </copy>
512
513                 <copy todir="${sp.home}/bin">
514                         <fileset dir="bin"/>
515                 </copy>
516                 <chmod dir="${sp.home}/bin" perm="ug+rx" includes="**/*"/>
517
518                 <mkdir dir="${sp.home}/logs" />
519
520                 <!-- copy sp configuration -->
521                 <if>
522                         <or>
523                                 <equals arg1="${copy-sp-conf}" arg2="y" />
524                                 <not> <available file="${sp.home}/etc" /> </not>
525                         </or>
526                         <then>
527                                 <delete dir="${sp.home}/etc" />
528                                 <antcall target="install.sp.filesystem.config" />
529                         </then>
530                 </if>
531
532         <antcall target="ext-invoke">
533             <param name="exts.dir" value="${custom}"/>
534             <param name="ext.build.function" value="ext-install-filesystem"/>
535             <param name="ext.filesystem.home" value="${sp.home}"/>
536             <param name="ext.home.token" value="$SP_HOME$"/>
537         </antcall>      
538         </target>
539
540
541         <!-- copy shibboleth configuration to $IDP_HOME/etc, overwriting any existing configuration -->
542         <target name="install.idp.filesystem.config" depends="init, install.init, install.url">
543                 <mkdir dir="${idp.home}/etc" />
544                 <copy todir="${idp.home}/etc" overwrite="true">
545                         <fileset dir="${src}/conf" includesfile="conf/idp-conf.include"/>
546                 </copy>
547                 <move file="${idp.home}/etc/dist.idp.xml" tofile="${idp.home}/etc/idp.xml" overwrite="true" />
548                 <replace file="${idp.home}/etc/idp.xml" token="$IDP_HOME$" value="${idp.home.url}" />
549                 <replace file="${idp.home}/etc/idp.xml" token="$IDP_WEBAPP_NAME$" value="${idp.webapp.name}" />
550         </target>
551
552         <!-- copy SP configuration to $SP_HOME$/etc, overwriting any existing configuration -->
553         <target name="install.sp.filesystem.config" depends="init, install.init">
554                 <mkdir dir="${sp.home}/etc" />
555                 <copy todir="${sp.home}/etc" overwrite="true">
556                         <fileset dir="${src}/conf" includesfile="conf/sp-conf.include"/>
557                 </copy>
558                 <move file="${sp.home}/etc/dist.sp-iqidp.xml" tofile="${sp.home}/etc/sp.xml" overwrite="true" />
559                 <replace file="${sp.home}/etc/sp.xml" token="$SP_HOME$" value="${sp.home.url}" />
560         </target>
561
562         <!-- install Shibboleth-IdP war using tomcat's manager app -->
563         <target name="install.idp.manager" depends="init, install.init">
564                 <antcall target="setupTomcatTasks" />
565
566                 <input message="Enter local tomcat directory [default: ${tomcat.home}]" addproperty="tomcat.home.input" defaultValue="${tomcat.home}" />
567                 <var name="tomcat.home" value="${tomcat.home.input}" />
568
569                 <input message="Enter tomcat url [default: ${tomcat.url}]" addproperty="tomcat.url.input" defaultValue="${tomcat.url}" />
570                 <var name="tomcat.url" value="${tomcat.url.input}" />
571
572                 <input message="Enter tomcat username [default: ${tomcat.username}]" addproperty="tomcat.username.input" defaultValue="${tomcat.username}" />
573                 <var name="tomcat.username" value="${tomcat.username.input}" />
574
575                 <input message="Enter tomcat password [default: ${tomcat.password}]" addproperty="tomcat.password.input" defaultValue="${tomcat.password}" />
576                 <var name="tomcat.password" value="${tomcat.password.input}" />
577
578         <antcall target="package-idp" />
579                 <antcall target="tomcat.deploy" />
580                 <antcall target="savePropertyFile" />
581         </target>
582
583         <!-- save configuration to build.properties -->
584         <target name="savePropertyFile">
585                 <propertyfile file="build.properties">
586                         <entry key="idp.home" value="${idp.home}" />
587                         <entry key="sp.home" value="${sp.home}" />
588                         <entry key="idp.webapp.name" value="${idp.webapp.name}" />
589                         <entry key="sp.webapp.name" value="${sp.webapp.name}" />
590                         <entry key="idp.install-type" value="${idp.install-type}" />
591                         <entry key="tomcat.home" value="${tomcat.home}" />
592                         <entry key="tomcat.url" value="${tomcat.url}" />
593                         <entry key="tomcat.username" value="${tomcat.username}" />
594                         <entry key="tomcat.password" value="${tomcat.password}" />
595                 </propertyfile>
596         </target>
597         <!-- For IDE development, run this target first to delete all
598         directories generated by the install process before
599         recreating and reinstalling everything. -->
600         <target name="clean-install" depends="init" 
601                 description="Delete old configuration and Tomcat webapp directories.">
602                 <delete dir="${idp.home}" />
603                 <delete dir="${sp.home}" />
604                 <delete dir="${tomcat.home}/webapps/${idp.webapp.name}" />
605                 <delete dir="${tomcat.home}/webapps/${sp.webapp.name}" />
606         </target>
607 </project>