(no commit message)
[utils] / build / header.xml
index 81a3a12c3b5ca38284196cd6a2325a4003a7de72..537f84f4719aa09518966bac4843ff6ff7782c43 100644 (file)
 
 <property name="project.home" value=".."/>
 <property name="build.dir" value="${project.home}/build"/>
-<property name="lib.dir" value="${project.home}/lib/wamblee"/>
+<property name="lib.dir" value="${project.home}/lib"/>
+<property environment="env"/>
 
 <target name="download.dep">
+  <if>
+    <isset property="proxyhost"/>
+    <then>
+      <setproxy proxyhost="${proxyhost}" proxyport="${proxyport}"/>
+    </then>
+  </if>
   <if>
     <isset property="artifact"/>
     <then>
   </antcall>
 </target>
 
+<target name="commons-email.d">
+  <antcall target="download.dep">
+    <param name="group" value="commons-email"/>
+    <param name="version" value="1.0"/>
+  </antcall>
+</target>
+
+<target name="servletapi.d">
+  <antcall target="download.dep">
+    <param name="group" value="servletapi"/>
+    <param name="version" value="2.4"/>
+  </antcall>
+</target>
+
+<target name="jstl.d">
+  <antcall target="download.dep">
+    <param name="group" value="jstl"/>
+    <param name="version" value="1.1.2"/>
+  </antcall>
+  <antcall target="download.dep">
+    <param name="group" value="taglibs"/>
+       <param name="artifact" value="standard"/>
+    <param name="version" value="1.1.2"/>
+  </antcall>
+</target>
+
+
+
+<target name="quartz.d">
+  <antcall target="download.dep">
+    <param name="group" value="quartz"/>
+    <param name="version" value="1.5.1"/>
+  </antcall>
+</target>
+
+
 
 <target name="logging.d" depends="log4j.d,commons-logging.d">
 </target>
   </antcall>
 </target>
 
-<target name="xerces.d">
+<target name="ehcache.d">
   <antcall target="download.dep">
     <param name="group" value="ehcache"/>
     <param name="version" value="1.1"/>
   </antcall>
 </target>
 
-<target name="ehcache.d">
+<target name="xerces.d">
   <antcall target="download.dep">
     <param name="group" value="xerces"/>
     <param name="version" value="2.4.0"/>
   </antcall>
 </target>
 
+<target name="activation.d">
+  <copy todir="${download.dir}">
+    <fileset dir="${special.lib.dir}/jaf-1.0.2">
+       <include name="*.jar"/>
+    </fileset>
+  </copy>
+</target>
+
+<target name="mail.d" depends="activation.d">
+  <copy todir="${download.dir}">
+    <fileset dir="${special.lib.dir}/javamail-1.3.3_01">
+       <include name="*.jar"/>
+    </fileset>
+  </copy>
+</target>
+
+
+
 <target name="httpclient.d">
   <antcall target="download.dep">
     <param name="group" value="commons-httpclient"/>
   </antcall>
 </target>
 
-<property name="support.dist.dir" value="${lib.dir}/support"/>
+<property name="support.dist.dir" value="${lib.dir}/wamblee/support"/>
 <target name="wamblee.support.d">
   <copy todir="${download.dir}">
     <fileset dir="${support.dist.dir}">
-      <include name="support.jar"/>
+      <include name="wamblee-support.jar"/>
     </fileset>
   </copy>
 </target>
 <target name="wamblee.support.test.d">
   <copy todir="${download.dir}">
     <fileset dir="${support.dist.dir}">
-      <include name="support-test.jar"/>
+      <include name="wamblee-support-test.jar"/>
     </fileset>
   </copy>
 </target>
 
-<property name="crawler.dist.dir" value="${lib.dir}/crawler"/>
-<target name="wamblee.crawler.d">
-  <copy todir="${download.dir}">
-    <fileset dir="${crawler.dist.dir}">
-      <include name="crawler.jar"/>
-    </fileset>
-  </copy>
-</target>
-<target name="wamblee.crawler.test.d">
-  <copy todir="${download.dir}">
-    <fileset dir="${crawler.dist.dir}">
-      <include name="crawler-test.jar"/>
-    </fileset>
-  </copy>
-</target>
 
 <target name="junit.d">
   <antcall target="download.dep">
 
 
  <target name="import_header" unless="build_header_included">
+    <property name="ant.lib.dir" value="${build.dir}/lib/ant"/>
+    <property name="test.lib.dir" value="lib/test"/>
+    <property name="special.lib.dir" value="${build.dir}/lib/special"/>
+       <property name="ant.downloaded.lib.dir" value="${build.dir}/lib/ant/downloaded"/>
+
+       
+    <!-- ========================================================================================
+         Ant task defs
+         ======================================================================================== -->
+    <!-- ant-contrib integration --> 
+    <property name="ant.contrib.home" value="${ant.lib.dir}/ant-contrib-1.0b2"/>
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+      <classpath>
+        <pathelement location="${ant.contrib.home}/ant-contrib.jar" />
+      </classpath>
+    </taskdef>
+    
+    <!-- taskdef for ant-dependencies task --> 
+    <taskdef name="dependencies" classpath="${ant.lib.dir}/ant-dependencies.jar" 
+      classname="org.apache.tools.ant.taskdefs.optional.dependencies.Dependencies"/>
+  
+    <!-- Emma integration --> 
+       <if>
+         <available file="${test.lib.dir}"/>
+         <then>
+        <path id="emma.lib">
+          <fileset dir="${test.lib.dir}" includes="emma*.jar"/>
+        </path>
+        <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
+        <property name="emma.enabled" value="false"/>
+         </then>
+    </if>
+    
+    <!-- checkstyle -->
+    <property name="checkstyle.home" value="${ant.downloaded.lib.dir}"/>
+    <taskdef resource="checkstyletask.properties">
+      <classpath>
+        <fileset dir="${checkstyle.home}">
+         <include name="*.jar"/>
+       </fileset>
+      </classpath>
+    </taskdef>
+    <property name="checkstyle.rules" value="style.xml"/>
+    <property name="checkstyle.test.rules" value="test-style.xml"/>
+    
+             
+    <!-- jalopy -->
+    <!-- TMP download this dependence as well 
+    <property name="jalopy.home" value="${lib.dir}/jalopy-ant-0.6.2"/>
+    <property name="jalopy.rules" value="${build.dir}/formatting-rules.xml"/>
+    <taskdef name="jalopy"
+         classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
+      <classpath>
+        <fileset dir="${jalopy.home}">
+          <include name="*.jar" />
+        </fileset>
+      </classpath>
+    </taskdef>
+    -->
+  
+    <!-- simian integration -->
+    <!-- TMP download this dependence as well 
+    <property name="simian.home" value="${lib.dir}/simian"/>
+    <taskdef resource="simiantask.properties" classpath="${simian.home}/simian.jar"/>
+    --> 
+    
+    <!-- macker integration -->
+    <!-- TMP download this dependence as well 
+    <property name="macker.home" value="${lib.dir}/macker-0.4.2"/>
+    <path id="macker.path">
+         <fileset dir="${macker.home}">
+           <include name="**/*.jar"/>
+         </fileset>
+    </path>
+    <taskdef name="macker"
+      classname="net.innig.macker.ant.MackerAntTask"
+      classpathref="macker.path"/>
+
+    --> 
     
     <!-- ========================================================================================
          Locate user properties to (optionally) override defaults
             in case the source is in a subdirectory and not necessarily
             in the top-level directory --> 
    
-    <property name="ant.lib.dir" value="${project.home}/lib/ant"/>
-    <property name="ant.downloaded.lib.dir" value="${project.home}/lib/ant/downloaded"/>
-    <property name="external.lib.dir" value="lib/external"/>
-    <property name="test.lib.dir" value="lib/test"/>
-    <property name="special.lib.dir" value="${project.home}/lib/special"/>
-    <property name="forrest.xdocs.dir" value="${project.home}/site/xdocs"/>
-    <property name="forrest.build.dir" value="${project.home}/site/build"/>
-    <property name="forrest.build.site.dir" value="${forrest.build.dir}/site"/>
+  
+       <if>
+         <isset property="webroot.dir"/>
+         <then>
+           <property name="external.lib.dir" value="${webroot.dir}/WEB-INF/lib"/>
+         </then>
+         <else>
+           <property name="external.lib.dir" value="lib/external"/>
+         </else>
+       </if>
+   
     <property name="build.properties.dir" value="${project.home}" />
     <property name="build.properties.name" value="build.properties" />
     
          ======================================================================================== -->
     <property name="database" value="Derby"/>
     
-    <!-- ========================================================================================
-         Ant task defs
-         ======================================================================================== -->
-    <!-- ant-contrib integration --> 
-    <property name="ant.contrib.home" value="${ant.lib.dir}/ant-contrib-1.0b2"/>
-    <taskdef resource="net/sf/antcontrib/antlib.xml">
-      <classpath>
-        <pathelement location="${ant.contrib.home}/ant-contrib.jar" />
-      </classpath>
-    </taskdef>
-    
-    <!-- taskdef for ant-dependencies task --> 
-    <taskdef name="dependencies" classpath="${ant.lib.dir}/ant-dependencies.jar" 
-      classname="org.apache.tools.ant.taskdefs.optional.dependencies.Dependencies"/>
-  
-    <!-- Emma integration --> 
-    <path id="emma.lib">
-      <fileset dir="${test.lib.dir}" includes="emma*.jar"/>
-    </path>
-    <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
-    <property name="emma.enabled" value="false"/>
-    
-    <!-- checkstyle -->
-    <property name="checkstyle.home" value="${ant.downloaded.lib.dir}"/>
-    <taskdef resource="checkstyletask.properties">
-      <classpath>
-        <fileset dir="${checkstyle.home}">
-         <include name="*.jar"/>
-       </fileset>
-      </classpath>
-    </taskdef>
-    <property name="checkstyle.rules" value="style.xml"/>
-    <property name="checkstyle.test.rules" value="test-style.xml"/>
-    
-             
-    <!-- jalopy -->
-    <!-- TMP download this dependence as well 
-    <property name="jalopy.home" value="${lib.dir}/jalopy-ant-0.6.2"/>
-    <property name="jalopy.rules" value="${build.dir}/formatting-rules.xml"/>
-    <taskdef name="jalopy"
-         classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
-      <classpath>
-        <fileset dir="${jalopy.home}">
-          <include name="*.jar" />
-        </fileset>
-      </classpath>
-    </taskdef>
-    -->
   
-    <!-- simian integration -->
-    <!-- TMP download this dependence as well 
-    <property name="simian.home" value="${lib.dir}/simian"/>
-    <taskdef resource="simiantask.properties" classpath="${simian.home}/simian.jar"/>
-    --> 
-    
-    <!-- macker integration -->
-    <!-- TMP download this dependence as well 
-    <property name="macker.home" value="${lib.dir}/macker-0.4.2"/>
-    <path id="macker.path">
-         <fileset dir="${macker.home}">
-           <include name="**/*.jar"/>
-         </fileset>
-    </path>
-    <taskdef name="macker"
-      classname="net.innig.macker.ant.MackerAntTask"
-      classpathref="macker.path"/>
-
-    --> 
    
     <!-- ========================================================================================
          Information
                       replace="/"
                       global="true"
                       defaultValue="${module.name}"/>
-       <property name="module.build.dir"
-               value="${build.dir}/${module.reldir}" />
-
+       <!-- property name="module.build.dir"
+               value="${build.dir}/${module.reldir}" / -->
+    <property name="module.build.dir" value="build"/>
        <property name="module.api.forrest.dir" value="${forrest.build.site.dir}/api/${module.name}" />
-       <!-- property name="module.classes.dir"     value="${module.build.dir}/bin"/ -->
-       <!-- property name="module.testclasses.dir" value="${module.build.dir}/testbin"/ -->
-       <property name="module.classes.dir" value="bin" />
-       <property name="module.testclasses.dir" value="testbin" />
+       <if>
+         <isset property="webroot.dir"/>
+         <then>
+           <property name="module.classes.dir" value="${webroot.dir}/WEB-INF/classes" />
+         </then>
+         <else>
+           <property name="module.classes.dir" value="${module.build.dir}/bin" />
+         </else>
+       </if>
+       
+       <property name="module.testclasses.dir" value="${module.build.dir}/testbin" />
        <!-- Directory where generated SQL will be put by the schema export-->
        <property name="module.sql.dir" value="${module.build.dir}/sql" />
 
         <property name="module.emmareport.dir"
                value="${module.report.dir}/html/emma"/>
        <property name="module.docbase.dir"
-               value="${module.build.dir}/javadoc" />
+               value="${module.build.dir}/docs" />
        <property name="module.javadoc.dir"
                value="${module.docbase.dir}/api" />
        <property name="module.javadocjar.name"
                value="${module.docbase.dir}/pdf" />
        <property name="module.doccheck.dir"
                value="${module.docbase.dir}/doccheck" />
+       <property name="module.checkstyle.dir"
+           value="${module.docbase.dir}/checkstyle" />
        <property name="module.jar.name" value="${module.name}.jar" />
        
        <!--  Replace the dash by a / to create a relative directory 
     
       Preparation:
       
+      To execute with a specific proxy host and port, start ant with the 
+      command-line options   -Dproxyhost=hostname -Dproxyport=portnumber.
+      
       deps:          Download dependencies, this is necessary for using 
                      any of the build targets.
       clean-deps:    Remove downloaded dependencies. 
       
       javadoc:       Generates javadoc. Target: ${module.javadoc.dir} 
       doccheck:      Checks documentation. Target: ${module.doccheck.dir}
+         
+         Forrest:
+         
+         forrest:       Generates project docs using forrest. 
       
       Code analysis: 
       
       checkstyle:    Checks the style of the code. 
       format:        Formats to the code in accordance with the checkstyle rules.
       simian:        Analyse similarities in the code.
+         
+         Building a web application: 
+         
+         To build a web application archive (WAR) you must set the property
+         webroot.dir to the value of the directory which is the root of your
+         web application. This must be done before the header.xl is 
+         sourced. The build support will then make sure that 
+         classes and libs are put in the correct directories below 
+         ${webroot.dir}/WEB-INF, and it will build a web archive. 
       
-      Database targets: 
+      Database targets:  ** database targets are not functional yet **
       
       For all targets below the database is configured using 
       hibernate.properties (hibernate.dialect property) and