Added support for custom extension building
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 8 Jul 2005 11:35:34 +0000 (11:35 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 8 Jul 2005 11:35:34 +0000 (11:35 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1690 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

build.xml

index 50f0852..a65a53b 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -16,6 +16,8 @@
     <property name="endorsed" value="${root}/endorsed/" />
     <property name="distlibs" value="${root}/lib/" />
     <property name="custom" value="${root}/custom/" />
+    <property name="custom.libs" value="${custom}/lib"/>
+    <property name="custom.webapges" value="${custom}/web"/>
     <property name="dist" value="${root}/dist/" />
     <property name="docs" value="${root}/doc/" />
     <property name="javadocs" value="${docs}/api/" />
@@ -27,6 +29,8 @@
     <!-- antcontrib tasks -->
     <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildlibs}/ant-contrib.jar"/>
 
+    <!-- Import the tasks for building custom extensions -->
+    <import file="${custom}/extension-build.xml"/>
 
     <!-- Construct the CLASSPATH -->
     <path id="build.path">
@@ -51,6 +55,8 @@
     <target name="init">
         <mkdir dir="${build}" />
         <mkdir dir="${dist}" />
+        <mkdir dir="${custom.libs}"/>
+        <mkdir dir="${custom.webapges}"/>
 
         <if>
             <not> <available file="build.properties" /> </not>
         <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on" source="1.4">
             <classpath refid="build.path" />
         </javac>
-               <!-- Compile site-specific code into the build path -->
-        <javac srcdir="${custom}" destdir="${build}" includes="**/*.java" debug="on" source="1.4">
-            <classpath refid="build.path" />
-        </javac>
                <!-- Copy xml schemas to the build path -->
         <copy todir="${build}/schemas">
             <fileset dir="${src}/schemas"/>
         </copy>
-               <!-- Copy any site-specific jars to the build path -->
-               <copy todir="${libdir}">
-               <fileset dir="${custom}" includes="**/*.jar" />
-        </copy>
+        
+        <!-- Build extensions -->
+        <antcall target="build-exts">
+            <param name="exts.dir" value="${custom}"/>
+        </antcall>
     </target>
 
 
 
     <!-- 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-all" depends="clean-build, clean-dist, clean-test, clean-javadocs, clean-util, clean-ext" />
     <target name="clean-build">
         <delete dir="${build}" />
+        <delete dir="${custom.libs}"/>
+        <delete dir="${custom.webapges}"/>
     </target>
     <target name="clean-test">
         <delete>
         <replace file="${configroot}/idp.xml" token="$IDP_HOME$" value="${idp.home.url}" />
        
        <!-- create the war -->
-        <war warfile="${dist}/${idp.webapp.name}.war" webxml="${configroot}/idp.xml" basedir="${approot}" update="no" />
+        <war warfile="${dist}/${idp.webapp.name}.war" webxml="${configroot}/idp.xml" basedir="${approot}" update="no">
+            <!-- Grab any custom extension libraries -->
+            <lib dir="${custom.libs}"/>
+            
+            <!-- Grab any web material from custom extensions -->
+            <fileset dir="${custom.webapges}"/>
+        </war>
        
        <!-- clean up generated descriptor -->
         <delete file="${configroot}/idp.xml"/>
         <replace file="${configroot}/sp.xml" token="$SP_HOME$" value="${sp.home.url}" />
        
        <!-- create the war -->
-        <war warfile="${dist}/${sp.webapp.name}.war" webxml="${configroot}/sp.xml" basedir="${approot}" update="no" />
+        <war warfile="${dist}/${sp.webapp.name}.war" webxml="${configroot}/sp.xml" basedir="${approot}" update="no">
+            <!-- Grab any custom extension libraries -->
+            <lib dir="${custom.libs}"/>
+                        
+            <!-- Grab any web material from custom extensions -->
+            <fileset dir="${custom.webapges}"/>
+        </war>
        
        <!-- clean up generated descriptor -->
         <delete file="${configroot}/sp.xml"/>