vmassol     2003/02/03 01:37:13

  Modified:    petals/ant build.xml build.properties.sample .cvsignore
  Log:
  Major refactoring of the build systems and directory layout:
  * Factorized common build parts into build-common.xml and normalized the builds
  * Added "release" target to all builds
  * Moved the sample-servlet and sample-jetty to samples/servlet and samples/jetty
  * Moved the web site upload to the documentation build
  * Simplified to the extreme the main Cactus build.xml and removed the 
build-admin.xml scripts
  * Removed some Ant tasks that were in anttasks/ as they are now in the Ant Petal
  * Some other cosmetic changes
  * Added scripts for Tomcat 3.x (However, I get a strange error while running Tomcat 
3.3.1. Not sure why yet (some flushbuffer() jasper error))
  * WL 7.x script has been tested and works (for JDK < 1.4)
  
  Several issues/todos remain:
  
  * The Gump build is probably not working at all (I'll correct it as I receive Gump 
email notifications of errors)
  * The Clover report is currently broken (i.e. not generated)
  * The sample-jetty needs to be put in line with the new build system and use the new 
Ant Petal
  * Pb of order in Sample Servlet test cases (one of the test must run before the 
other but this is not currently possible with the Ant Petal)
  * WL 6.x script needs to be tested
  
  Revision  Changes    Path
  1.5       +75 -203   jakarta-cactus/petals/ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/petals/ant/build.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- build.xml 31 Jan 2003 12:15:08 -0000      1.4
  +++ build.xml 3 Feb 2003 09:37:13 -0000       1.5
  @@ -1,18 +1,20 @@
   <?xml version="1.0"?>
   <!DOCTYPE project [
  -    <!ENTITY common SYSTEM "file:../../common.xml">
  +    <!ENTITY common SYSTEM "file:../../build-common.xml">
   ]>
   
   <!--
     =============================================================================
       Build file for the Cactus Ant Petal project.
   
  +    See build.properties.sample for mandatory and optional Ant properties that
  +    need to be set prior to calling this build script.
  +
       This script should be started with the following command line :
   
           ant <target>
   
  -    Run "ant -projecthelp" to get a list of available targets. The default
  -    target is "dist"
  +    Run "ant -projecthelp" to get a list of available targets.
   
       Note: basedir points to the main Cactus directory in order to have the same
             base dir for all Cactus subprojects and thus be able to share
  @@ -21,149 +23,50 @@
   -->
   <project name="Cactus Ant Petal" default="dist" basedir="../..">
   
  -    <!-- Give user a chance to override without editing this file
  -         (and without typing -D each time it compiles it) -->
  -    <property file="${basedir}/petals/ant/build.properties" />
  -    <property file="${basedir}/build.properties" />
  -    <property file="${user.home}/build.properties" />
  +    <!-- Base directory for all file related operations -->
  +    <property name="base.dir" value="petals/ant"/>
  +
  +    <!-- Include properties and targets common to the different subprojects -->
  +    &common;
   
       <!-- Global project properties -->
       <property name="project.name.text" value="Cactus Ant Petal"/>
       <property name="project.name.file" value="cactus-petal-ant"/>
  -    <property name="project.version" value="1.5dev"/>
  -
  -    <!-- Prefix to add to all distributable files -->
  -    <property name="project.prefix" value="jakarta-"/>
  -
  -    <!--
  -       ========================================================================
  -         Default values for properties not defined in build.properties or in
  -         a higher level calling Ant script
  -       ========================================================================
  -    -->
  -    <property name="year" value="2000-2003"/>
  -    <property name="debug" value="on"/>
  -    <property name="optimize" value="off"/>
  -    <property name="deprecation" value="off"/>
  -
  -    <!-- The location of the Cactus custom Ant tasks jar -->
  -    <property name="cactus.ant.jar" value="anttasks/dist/lib/cactus-ant.jar"/>
  -
  -    <!--
  -       ========================================================================
  -         Base directory for all file related operations
  -       ========================================================================
  -    -->
  -    <property name="base.dir" location="petals/ant"/>
   
       <!--
          ========================================================================
  -         Set the properties related to the source tree.
  -         Note: These properties are defined in a target as some need the
  -               j2ee.api property to be set
  +         Initialize source, target and dist properties
          ========================================================================
       -->
  -    <target name="properties.source">
  +    <target name="properties">
   
  -         <property name="src.dir" location="${base.dir}/src"/>
  -         <property name="src.java.dir" location="${src.dir}/java"/>
  -         <property name="src.script.dir" location="${src.dir}/scripts"/>
  -         <property name="src.conf.dir" location="${src.dir}/confs"/>
  -         <property name="build.dir" location="${base.dir}/."/>
  -
  -         <!-- The location of the web files generated by the Cactus framework
  -              (i.e. the JSP Redirector) -->
  -         <property name="cactus.framework.web" 
  -             value="framework/dist-${j2ee.api}/web"/>
  -
  -         <!-- The location of the Cactus framework jar -->
  -        <property name="cactus.framework.jar"
  -            value="framework/dist-${j2ee.api}/lib/cactus.jar"/>
  +        <!-- Set the properties related to the source tree -->
  +         <property name="src.dir" value="${base.dir}/src"/>
  +         <property name="src.java.dir" value="${src.dir}/java"/>
  +         <property name="src.script.dir" value="${src.dir}/scripts"/>
  +         <property name="src.conf.dir" value="${src.dir}/confs"/>
  +         <property name="build.dir" value="${base.dir}/."/>
   
  -     </target>
  -     
  -    <!--
  -       ========================================================================
  -         Set the properties related to the target tree
  -         Note: These properties are defined in a target as some need the
  -               j2ee.api property to be set
  -       ========================================================================
  -    -->
  -    <target name="properties.target">
  -
  -         <property name="target.dir" location="${base.dir}/target-${j2ee.api}"/>
  -         <property name="target.classes.dir" location="${target.dir}/classes"/>
  +        <!-- Set the properties related to the target area -->
  +         <property name="target.classes.dir" value="${target.dir}/classes"/>
            <property name="target.classes.java.dir"
  -             location="${target.classes.dir}/java"/>
  -         <property name="target.doc.dir" location="${target.dir}/doc"/>
  -         <property name="target.doc.api.dir" location="${target.doc.dir}/api"/>
  +             value="${target.classes.dir}/java"/>
  +         <property name="target.doc.dir" value="${target.dir}/doc"/>
  +         <property name="target.doc.api.dir" value="${target.doc.dir}/api"/>
   
  -        <property name="target.petal.dir" location="${target.dir}/petal"/>
  +        <property name="target.petal.dir" value="${target.dir}/petal"/>
           <property name="target.petal.lib.dir" 
  -            location="${target.petal.dir}/lib"/>
  +            value="${target.petal.dir}/lib"/>
            <property name="target.petal.lib.client.dir" 
  -             location="${target.petal.lib.dir}/client"/>
  +             value="${target.petal.lib.dir}/client"/>
            <property name="target.petal.lib.server.dir"
  -             location="${target.petal.lib.dir}/server"/>
  +             value="${target.petal.lib.dir}/server"/>
            <property name="target.petal.lib.common.dir"
  -             location="${target.petal.lib.dir}/common"/>
  +             value="${target.petal.lib.dir}/common"/>
            <property name="target.petal.script.dir" 
  -             location="${target.petal.dir}/scripts"/>
  +             value="${target.petal.dir}/scripts"/>
            <property name="target.petal.conf.dir" 
  -             location="${target.petal.dir}/confs"/>
  -
  -     </target>
  -
  -    <!--
  -       ========================================================================
  -         Set the properties related to the distribution tree
  -         Note: These properties are defined in a target as some need the
  -               j2ee.api property to be set
  -       ========================================================================
  -    -->
  -    <target name="properties.distribution">
  -
  -         <property name="dist.dir" location="${base.dir}/dist-${j2ee.api}"/>
  -         <property name="dist.bin.dir" location="${dist.dir}/bin"/>
  -         <property name="dist.doc.dir" location="${dist.dir}/doc"/>
  -         <property name="dist.doc.api.dir" location="${dist.doc.dir}/api"/>
  -
  -     </target>
  -
  -    <!--
  -       ========================================================================
  -        Names of deliverables
  -       ========================================================================
  -    -->
  -
  -    <!-- The Ant Petal jar and helper classes -->
  -    <property name="antpetal.jar.name" value="${project.name.file}"/>
  -
  -    <!-- The global Ant Petal zip -->
  -     <property name="antpetal.zip.name" value="${project.name.file}"/>
  -     
  -    <!--
  -       ========================================================================
  -         Include common targets and properties
  -       ========================================================================
  -    -->
  -    &common;
  -
  -    <!--
  -       ========================================================================
  -         Display configurable properties values
  -       ========================================================================
  -    -->
  -    <target name="display.properties">
  -
  -        <echo>----- ${project.name.text} ${project.version} -----</echo>
  -        <echo></echo>
  -        <echo>java.class.path = ${java.class.path}"</echo>
  -        <echo></echo>
  -        <echo>java.home = ${java.home}</echo>
  -        <echo>user.home = ${user.home}</echo>
  -        <echo>ant.home = ${ant.home}</echo>
  -        <echo></echo>
  +             value="${target.petal.dir}/confs"/>
   
       </target>
   
  @@ -174,9 +77,10 @@
       -->
       <target name="check.properties">
   
  -        <taskdef name="checkProperty" 
classname="org.apache.cactus.ant.CheckPropertiesTask">
  +        <taskdef name="checkProperty" 
  +            classname="org.apache.cactus.ant.CheckPropertiesTask">
               <classpath>
  -                <pathelement location="${cactus.ant.jar}"/>
  +                <pathelement location="${cactus.anttasks.jar}"/>
               </classpath>
           </taskdef>
   
  @@ -194,51 +98,11 @@
   
       <!--
          ========================================================================
  -         Find out the J2EE API version
  -       ========================================================================
  -    -->
  -    <target name="check.j2ee.version">
  -
  -        <condition property="j2ee.api" value="13">
  -            <available classname="javax.servlet.Filter">
  -                 <classpath>
  -                     <pathelement location="${j2ee.jar}"/>
  -                 </classpath>
  -            </available>
  -        </condition>
  -
  -        <condition property="j2ee.api" value="12">
  -            <available classname="javax.servlet.Servlet">
  -                 <classpath>
  -                     <pathelement location="${j2ee.jar}"/>
  -                 </classpath>
  -            </available>
  -        </condition>
  -
  -        <fail message="Unsupported J2EE version" unless="j2ee.api"/>
  -
  -        <echo message="j2ee.api = ${j2ee.api}"/>
  -
  -    </target>
  -
  -    <!--
  -       ========================================================================
  -         Load all dynamic properties
  -       ========================================================================
  -    -->
  -    <target name="load.properties"
  -        
depends="check.j2ee.version,properties.source,properties.target,properties.distribution"/>
  -
  -    <!--
  -       ========================================================================
            Initialize the build. Must be called by all targets
          ========================================================================
       -->
       <target name="init"
  -        depends="display.properties,check.properties,load.properties">
  -
  -        <tstamp/>
  -
  +        depends="init.common,properties,check.properties">
       </target>
   
       <!--
  @@ -251,7 +115,8 @@
           <mkdir dir="${target.classes.java.dir}"/>
   
           <javac srcdir="${src.java.dir}" destdir="${target.classes.java.dir}"
  -          deprecation="${deprecation}" optimize="${optimize}"/>
  +          deprecation="${deprecation}" optimize="${optimize}" 
  +          debug="${debug}"/>
   
       </target>
   
  @@ -262,7 +127,7 @@
       -->
       <target name="jar" depends="compile" description="Generate the petal jar">
   
  -        <jar jarfile="${target.dir}/${antpetal.jar.name}.jar">
  +        <jar jarfile="${target.dir}/${cactus.antpetal.jar.name}.jar">
   
               <manifest>
                   <section name="org/apache/cactus/petal/ant/">
  @@ -294,8 +159,7 @@
            Generate the documentation (javadoc)
          ========================================================================
       -->
  -    <target name="doc.check"
  -        depends="init">
  +    <target name="doc.check" depends="init">
   
         <uptodate property="doc.uptodate"
             targetfile="${target.doc.api.dir}/index.html">
  @@ -305,9 +169,7 @@
   
       </target>
   
  -    <target name="doc"
  -        depends="doc.check"
  -        unless="doc.uptodate"
  +    <target name="doc" depends="doc.check" unless="doc.uptodate"
           description="Generates the API documentation">
   
           <mkdir dir="${target.doc.api.dir}"/>
  @@ -347,13 +209,18 @@
           <!-- (None at the moment) -->
           
                <!-- Gather all client side Cactus jars -->
  -        <copy 
tofile="${target.petal.lib.client.dir}/${antpetal.jar.name}-${project.version}.jar"
  -            file="${target.dir}/${antpetal.jar.name}.jar"/>
  -        <copy todir="${target.petal.lib.client.dir}" file="${j2ee.jar}"/>
  +        <copy 
tofile="${target.petal.lib.client.dir}/${cactus.antpetal.jar.name}-${project.version}.jar"
  +            file="${target.dir}/${cactus.antpetal.jar.name}.jar"/>
  +
  +        <!-- Note: ATM we copy the servlet jar (and not the J2EE one). The 
  +             reasons are that ATM we only need the servlet API and that the
  +             J2EE jar is not redistributable -->
  +        <copy todir="${target.petal.lib.client.dir}" file="${servlet.jar}"/>
  +
           <copy todir="${target.petal.lib.client.dir}" 
file="${commons.httpclient.jar}"/>
   
                <!-- Gather all shared (client and server) Cactus jars -->
  -        <copy tofile="${target.petal.lib.common.dir}/cactus-${project.version}.jar" 
  +        <copy 
tofile="${target.petal.lib.common.dir}/${cactus.framework.jar.name}-${project.version}.jar"
                file="${cactus.framework.jar}"/>
           <copy todir="${target.petal.lib.common.dir}" file="${commons.logging.jar}"/>
           <copy todir="${target.petal.lib.common.dir}" file="${log4j.jar}"/>
  @@ -363,10 +230,10 @@
   
                <!-- Copy the scripts for the current J2EE API -->
   
  -        <filter token="cactus.petal.ant.jar.name" 
  -             value="${antpetal.jar.name}-${project.version}.jar"/>
  +        <filter token="cactus.antpetal.jar.name" 
  +             value="${cactus.antpetal.jar.name}-${project.version}.jar"/>
           <filter token="cactus.framework.jar.name" 
  -             value="cactus-${project.version}.jar"/>
  +             value="${cactus.framework.jar.name}-${project.version}.jar"/>
   
                <basename property="log4j.jar.name" file="${log4j.jar}"/>
           <filter token="log4j.jar.name" value="${log4j.jar.name}"/>
  @@ -408,10 +275,11 @@
           <mkdir dir="${dist.bin.dir}"/>
           <mkdir dir="${dist.doc.api.dir}"/>
           
  -        <zip zipfile="${dist.bin.dir}/${antpetal.zip.name}.zip">
  -            <fileset dir="${target.petal.dir}"/>           
  -        </zip>
  -
  +        <!-- Copy the petal -->
  +        <copy todir="${dist.bin.dir}/${project.name.file}">
  +            <fileset dir="${target.petal.dir}"/>
  +        </copy>
  +        
           <!-- Copy the generated documentation -->
           <copy todir="${dist.doc.api.dir}">
               <fileset dir="${target.doc.api.dir}"/>
  @@ -421,24 +289,10 @@
   
       <!--
          ========================================================================
  -         Clean generated files (including distributables)
  -       ========================================================================
  -    -->
  -    <target name="clean" depends="load.properties"
  -     description="Clean all generated files">
  -
  -        <delete dir="${target.dir}"/>
  -        <delete dir="${dist.dir}"/>
  -
  -    </target>
  -
  -    <!--
  -       ========================================================================
            Perform a code audit using CheckStyle.
          ========================================================================
       -->
  -    <target name="checkstyle"
  -        depends="init, init.checkstyle"
  +    <target name="checkstyle" depends="init,init.checkstyle"
           if="checkstyle.available"
           description="Perform a code audit using Checkstyle">
   
  @@ -458,6 +312,24 @@
               <property key="checkstyle.header.file" file="./LICENSE.cactus"/>
           </checkstyle>
   
  +    </target>
  +
  +    <!--
  +       ========================================================================
  +         Generate the release
  +       ========================================================================
  +    -->
  +    <target name="release" depends="clean,dist"
  +        description="Generate the release files">
  +
  +        <mkdir dir="${release.dir}"/>
  +
  +        <zip destfile="${release.dir}/${main.release.name}.zip">
  +            <zipfileset dir="${dist.bin.dir}/${project.name.file}" 
  +                prefix="${main.release.name}">
  +            </zipfileset>
  +        </zip>
  +        
       </target>
   
   </project>
  
  
  
  1.4       +63 -58    jakarta-cactus/petals/ant/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/petals/ant/build.properties.sample,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.properties.sample   26 Jan 2003 22:18:08 -0000      1.3
  +++ build.properties.sample   3 Feb 2003 09:37:13 -0000       1.4
  @@ -1,58 +1,63 @@
  -# -----------------------------------------------------------------------------
  -# build.properties.sample
  -#
  -# This is an example "build.properties" file, used to customize building the
  -# Cactus Ant Petal for your local environment.  Make any changes you need, and
  -# rename this file to "build.properties" in the same directory that contains the
  -# "build.xml" file.
  -#
  -# $Id$
  -# -----------------------------------------------------------------------------
  -
  -# WARNING:  The relative paths below are relative to the directory where the
  -# build.xml file is located.
  -
  -# -----------------------------------------------------------------------------
  -# Mandatory properties
  -# -----------------------------------------------------------------------------
  -
  -# Location of all jars. Note: This is not a mandatory property. It is only
  -# used here so that it can be reused when defining the location of all the jars
  -# below. You do not have to put all the external jars in a single location.
  -lib.repo = c:/apps/maven/repository
  -
  -# The location of the J2EE API jar. Depending on the version (1.2 or 1.3) of
  -# it, the corresponding Cactus Framework will be built. For example if you use
  -# J2EE 1.3 jar, then the Cactus jar will contain the Filter Redirector which is
  -# only available for Servlet 2.3 (part of J2EE 1.3).
  -j2ee.jar = ${lib.repo}/servletapi/jars/servletapi-2.3.jar
  -
  -# The location of the Commons Logging jar
  -commons.logging.jar = ${lib.repo}/commons-logging/jars/commons-logging-1.0.1.jar
  -
  -# The location of the log4j jar
  -log4j.jar = ${lib.repo}/log4j/jars/log4j-1.2.6.jar
  -
  -# The location of the Commons Httpclient jar
  -commons.httpclient.jar = 
${lib.repo}/commons-httpclient/jars/commons-httpclient-2.0alpha2-20030125.jar
  -
  -# The location of the Httpunit jar
  -httpunit.jar = ${lib.repo}/httpunit/jars/httpunit-1.4.5.jar
  -
  -# The location of the AspectJ runtime jar
  -aspectjrt.jar = ${lib.repo}/aspectj/jars/aspectjrt-1.0.6.jar
  -
  -# The location of the Junit jar
  -junit.jar = ${lib.repo}/junit/jars/junit-3.8.1.jar
  -
  -# -----------------------------------------------------------------------------
  -# Optional properties
  -# -----------------------------------------------------------------------------
  -
  -# Dependancies for Checkstyle code auditing
  -# If not specified here, the JARs must be present in ANTHOME/lib
  -antlr.jar = ${lib.repo}/antlr/jars/antlr-2.7.1.jar
  -checkstyle.jar = ${lib.repo}/checkstyle/jars/checkstyle-2.4.jar
  -commons-beanutils.jar = 
${lib.repo}/commons-beanutils/jars/commons-beanutils-1.5.jar
  -commons-collections.jar = 
${lib.repo}/commons-collections/jars/commons-collections-2.1.jar
  -regexp.jar = ${lib.repo}/regexp/jars/regexp-1.2.jar
  +# -----------------------------------------------------------------------------
  +# build.properties.sample
  +#
  +# This is an example "build.properties" file, used to customize building the
  +# Cactus Ant Petal for your local environment.  Make any changes you need, and
  +# rename this file to "build.properties" in the same directory that contains the
  +# "build.xml" file.
  +#
  +# $Id$
  +# -----------------------------------------------------------------------------
  +
  +# WARNING:  The relative paths below are relative to the directory where the
  +# build.xml file is located.
  +
  +# -----------------------------------------------------------------------------
  +# Mandatory properties
  +# -----------------------------------------------------------------------------
  +
  +# Location of all jars. Note: This is not a mandatory property. It is only
  +# used here so that it can be reused when defining the location of all the jars
  +# below. You do not have to put all the external jars in a single location.
  +lib.repo = c:/apps/maven/repository
  +
  +# The location of the J2EE API jar. Depending on the version (1.2 or 1.3) of
  +# it, the corresponding Cactus Framework will be built. For example if you use
  +# J2EE 1.3 jar, then the Cactus jar will contain the Filter Redirector which is
  +# only available for Servlet 2.3 (part of J2EE 1.3).
  +j2ee.jar = ${lib.repo}/servletapi/jars/servletapi-2.3.jar
  +
  +# Note: ATM we copy the servlet jar (and not the J2EE one). The reasons are 
  +# that ATM we only need the servlet API and that the J2EE jar is not 
  +# redistributable.
  +servlet.jar = ${lib.repo}/servletapi/jars/servletapi-2.3.jar
  +
  +# The location of the Commons Logging jar
  +commons.logging.jar = ${lib.repo}/commons-logging/jars/commons-logging-1.0.1.jar
  +
  +# The location of the log4j jar
  +log4j.jar = ${lib.repo}/log4j/jars/log4j-1.2.6.jar
  +
  +# The location of the Commons Httpclient jar
  +commons.httpclient.jar = 
${lib.repo}/commons-httpclient/jars/commons-httpclient-2.0alpha2-20030125.jar
  +
  +# The location of the Httpunit jar
  +httpunit.jar = ${lib.repo}/httpunit/jars/httpunit-1.4.5.jar
  +
  +# The location of the AspectJ runtime jar
  +aspectjrt.jar = ${lib.repo}/aspectj/jars/aspectjrt-1.0.6.jar
  +
  +# The location of the Junit jar
  +junit.jar = ${lib.repo}/junit/jars/junit-3.8.1.jar
  +
  +# -----------------------------------------------------------------------------
  +# Optional properties
  +# -----------------------------------------------------------------------------
  +
  +# Dependancies for Checkstyle code auditing
  +# If not specified here, the JARs must be present in ANTHOME/lib
  +antlr.jar = ${lib.repo}/antlr/jars/antlr-2.7.1.jar
  +checkstyle.jar = ${lib.repo}/checkstyle/jars/checkstyle-2.4.jar
  +commons-beanutils.jar = ${lib.repo}/commons-beanutils/jars/commons-beanutils-1.5.jar
  +commons-collections.jar = 
${lib.repo}/commons-collections/jars/commons-collections-2.1.jar
  +regexp.jar = ${lib.repo}/regexp/jars/regexp-1.2.jar
  
  
  
  1.3       +2 -0      jakarta-cactus/petals/ant/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/petals/ant/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore        26 Jan 2003 22:21:35 -0000      1.2
  +++ .cvsignore        3 Feb 2003 09:37:13 -0000       1.3
  @@ -3,4 +3,6 @@
   dist-13
   target-12
   target-13
  +release-12
  +release-13
   ant.bat
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to