Cleanup.
[java-idp.git] / build.xml
index 1357d1b..441a0f7 100755 (executable)
--- a/build.xml
+++ b/build.xml
 
        <!-- Construct the CLASSPATH -->
        <path id="build.path">
-               <pathelement path="${classpath}" />
                <pathelement location="${build}" />
-               <fileset dir="${custom}">
-                       <include name="**/*.jar" />
-               </fileset>
                <fileset dir="${endorsed}">
                        <include name="**/*.jar" />
                </fileset>
 
        <!-- Cleanup after the build, test, and distribution processes -->
        <target name="clean" depends="clean-all" />
-       <target name="clean-all" depends="clean-build, clean-dist, clean-test, clean-javadocs, clean-util" />
-       <target name="clean-build">
+
+    <target name="clean-all" depends="clean-build, clean-dist, clean-test, clean-javadocs, clean-util"/>
+       
+    <target name="clean-build">
                <delete dir="${build}" />
                <delete dir="${custom.libs}"/>
                <delete dir="${custom.webapges}"/>
            <antcall target="ext-invoke">
                <param name="exts.dir" value="${custom}"/>
-            <param name="ext.build.function" value="ext-clean"/>   
+            <param name="ext.build.function" value="ext-clean-build"/>   
            </antcall>
        </target>
-       <target name="clean-test">
+       
+    <target name="clean-test">
                <delete>
                        <fileset dir="${root}">
                                <include name="**/TEST*.txt" />
                        </fileset>
                </delete>
        </target>
-       <target name="clean-dist">
+       
+    <target name="clean-dist">
                <delete dir="${dist}" />
+        <antcall target="ext-invoke">
+            <param name="exts.dir" value="${custom}"/>
+            <param name="ext.build.function" value="ext-clean-dist"/>   
+        </antcall>   
        </target>
-       <target name="clean-javadocs">
+       
+    <target name="clean-javadocs">
                <delete dir="${javadocs}" />
+        <antcall target="ext-invoke">
+            <param name="exts.dir" value="${custom}"/>
+            <param name="ext.build.function" value="ext-clean-javadocs"/>   
+        </antcall>
        </target>
-       <target name="clean-util">
+       
+    <target name="clean-util">
                <delete>
                        <fileset dir="${buildlibs}">
                                <include name="shib-util.jar" />
                        </fileset>
                </delete>
        </target>
-       <!-- For IDE development, run this target first to delete all
-       directories generated by the install process before
-       recreating and reinstalling everything. -->
-       <target name="clean-install" depends="init" 
-               description="Delete old configuration and Tomcat webapp directories.">
-               <delete dir="${idp.home}" />
-               <delete dir="${sp.home}" />
-               <delete dir="${tomcat.home}/webapps/${idp.webapp.name}" />
-               <delete dir="${tomcat.home}/webapps/${sp.webapp.name}" />
-       </target>
-
 
        <!-- Add to the classpath for unit tests -->
        <path id="test.path">
 
 
        <!-- Tomcat Management -->
-       <target name="setupTomcatTasks">
+       <target name="setupTomcatTasks" depends="init">
                <path id="tomcat.classpath">
                        <fileset dir="${tomcat.home}/server/lib" includes="catalina-ant.jar"/>
                </path>
                <!-- copy values to deployment descriptor -->
                <copy file="${configroot}/${idp.deployment.descriptor}" tofile="${configroot}/idp.xml" overwrite="true" />
                <replace file="${configroot}/idp.xml" token="$IDP_HOME$" value="${idp.home.url}" />
+     
+        <!-- package extensions -->
+        <antcall target="ext-invoke">
+            <param name="exts.dir" value="${custom}"/>
+            <param name="ext.build.function" value="ext-package"/>
+            <param name="ext.filesystem.home" value="${idp.home}"/>
+            <param name="ext.home.token" value="$IDP_HOME$"/>
+        </antcall>
 
                <!-- create the war -->
                <war warfile="${dist}/${idp.webapp.name}.war" webxml="${configroot}/idp.xml" basedir="${approot}" update="no" duplicate="preserve">
                <copy file="${configroot}/${sp.deployment.descriptor}" tofile="${configroot}/sp.xml" overwrite="true" />
                <replace file="${configroot}/sp.xml" token="$SP_HOME$" value="${sp.home.url}" />
 
+        <!-- package extensions -->
+        <antcall target="ext-invoke">
+            <param name="exts.dir" value="${custom}"/>
+            <param name="ext.build.function" value="ext-package"/>
+            <param name="ext.filesystem.home" value="${sp.home}"/>
+            <param name="ext.home.token" value="$SP_HOME$"/>
+        </antcall>
+        
                <!-- create the war -->
                <war warfile="${dist}/${sp.webapp.name}.war" webxml="${configroot}/sp.xml" basedir="${approot}" update="no">
                        <!-- Grab any custom extension libraries -->
                <if>
                        <available file="${idp.home}/etc" />
                        <then>
-                               <echo>-----------------------------------------------------------------------------------------------------------</echo>
+                               <echo>--------------------------------------------------------------------------------------</echo>
                                <echo>---</echo>
-                               <echo>---   NOTE:  Existing Identiity Provider configuration at ${idp.home}/etc will not be overwritten.</echo>
+                               <echo>---   NOTE:  Existing Identiity Provider configuration at ${idp.home}/etc ${line.separator}---   will not be overwritten.</echo>
                                <echo>---</echo>
-                               <echo>-----------------------------------------------------------------------------------------------------------</echo>
+                               <echo>--------------------------------------------------------------------------------------</echo>
                                <property name="copy-idp-conf" value="n" />
                        </then>
                        <else>
                        <fileset dir="lib" includesfile="conf/idp-lib.include" />
                </copy>
 
+               <copy todir="${idp.home}/endorsed">
+                       <fileset dir="endorsed" />
+               </copy>
+
                <copy todir="${idp.home}/bin">
                        <fileset dir="bin"/>
                </copy>
 
         <antcall target="ext-invoke">
             <param name="exts.dir" value="${custom}"/>
-            <param name="ext.build.function" value="${ext-install-filesystem}"/>
+            <param name="ext.build.function" value="ext-install-filesystem"/>
             <param name="ext.filesystem.home" value="${sp.home}"/>
             <param name="ext.home.token" value="$SP_HOME$"/>
         </antcall>      
                <input message="Enter tomcat password [default: ${tomcat.password}]" addproperty="tomcat.password.input" defaultValue="${tomcat.password}" />
                <var name="tomcat.password" value="${tomcat.password.input}" />
 
+        <antcall target="package-idp" />
                <antcall target="tomcat.deploy" />
                <antcall target="savePropertyFile" />
        </target>