cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: cocoon-2.1/tools/new-targets admin-build.xml compile-build.xml dist-build.xml docs-build.xml forrest-build.xml ide-build.xml init-build.xml instrumentation-build.xml samples-build.xml standalone-demo-build.xml test-build.xml tools-build.xml upgrade-build.xml validate-build.xml webapp-build.xml
Date Wed, 26 May 2004 10:04:34 GMT
nicolaken    2004/05/26 03:04:34

  Added:       tools/new-targets admin-build.xml compile-build.xml
                        dist-build.xml docs-build.xml forrest-build.xml
                        ide-build.xml init-build.xml
                        instrumentation-build.xml samples-build.xml
                        standalone-demo-build.xml test-build.xml
                        tools-build.xml upgrade-build.xml
                        validate-build.xml webapp-build.xml
  Log:
  Starting the new build system
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/tools/new-targets/admin-build.xml
  
  Index: admin-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="admin">
    
    <description>
      Admin targets
    </description>
    
    <!-- Creates the web site  -->
    <target name="site" depends="forrest, javadocs" description="[admin] Builds the site">
      <mkdir dir="${site}"/>
      <copy todir="${site}" filtering="off">
        <fileset dir="${build.site}"/>
      </copy>
      <copy todir="${site}/apidocs" filtering="off">
        <fileset dir="${build.javadocs}"/>
      </copy>
    </target>
  
    <!-- Create the announcements -->
    <target name="announcement" depends="prepare-docs">
      <copy file="announcement.xml" tofile="${build.context}/xdocs/announcement.xml" filtering="on"/>
      <xslt in="${build.context}/xdocs/announcement.xml"
            out="${build}/announcement.txt"
            style="${build.context}/stylesheets/announcement2txt.xsl"
            force="true"/>
    </target>
  
    <target name="generate-blocks.properties" depends="init">
      <xslt in="gump.xml"
            out="blocks.properties"
            style="${tools.src}/gump2blocks.properties.xsl"
            force="true"/>
    </target>
  
  <!-- === Gump Targets ====================================================== -->
  
    <!-- compiles and packages the core classes and the deprecated classes -->
    <target name="gump-core" depends="package-core, package-deprecated, javadocs, validate-jars, junit-tests"/>
  
    <!-- compiles and packages a single block identified by ${block-name} -->
    <target name="gump-block" depends="compile-core, compile-deprecated, prepare-blocks, compile-tests">
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="cocoon-block-${block-name}-tests"/>
    </target>
  </project>
  
  
  1.1                  cocoon-2.1/tools/new-targets/compile-build.xml
  
  Index: compile-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="compile">
  
    <description>
      Compilation Targets
    </description>
  
    <!-- compiles everything -->
    <target name="compile"
        depends="compile-core, compile-deprecated, compile-tests"/>
  
    <!-- compiles the core -->
    <target name="compile-core" depends="prepare">
  
      <!-- copy those files that need to be in the classpath -->
      <copy todir="${build.dest}">
        <fileset dir="${java}">
          <exclude name="**/*.java"/>
          <exclude name="**/*.xroles"/>
          <exclude name="**/*.xconf"/>
        </fileset>
      </copy>
  
      <!-- compile mock classes -->
      <mkdir dir="${build.mocks}"/>
      <javac srcdir="${mocks}"
             destdir="${build.mocks}"
             debug="${compiler.debug}"
             optimize="${compiler.optimize}"
             deprecation="${compiler.deprecation}"
             target="${target.vm}"
             nowarn="${compiler.nowarn}"
             compiler="${compiler}"
             classpathref="classpath"/>
  
      <!-- compile core source files -->
      <javac srcdir="${java}"
             destdir="${build.dest}"
             debug="${compiler.debug}"
             optimize="${compiler.optimize}"
             deprecation="${compiler.deprecation}"
             target="${target.vm}"
             nowarn="${compiler.nowarn}"
             compiler="${compiler}"
             classpathref="classpath"/>
    </target>
  
    <!-- compiles deprecated code -->
    <target name="compile-deprecated" depends="prepare"
        unless="internal.exclude.deprecated">
      <mkdir dir="${build.deprecated}"/>
  
  <!--
      <xpatch file="${build.dest}/org/apache/cocoon/cocoon.roles" 
              srcdir="${deprecated.conf}"
              includes="**/*.xroles"/>
  -->
      <javac srcdir="${deprecated.src}"
             destdir="${build.deprecated}"
             debug="${compiler.debug}"
             optimize="${compiler.optimize}"
             deprecation="${compiler.deprecation}"
             target="${target.vm}"
             compiler="${compiler}"
             classpathref="classpath"/>
    </target>
  
    <target name="compile-tests" depends="compile-core, compile-deprecated">
      <mkdir dir="${build.test}"/>
  
      <!-- Copy test files to build test dir -->
      <copy todir="${build.test}" filtering="on">
        <fileset dir="${test}" excludes="**/*.java"/>
      </copy>
  
      <path id="test.classpath">
        <path refid="classpath"/>
        <pathelement location="${build.dest}" />
         <!-- FIXME Resolver tests depend on deprecated stuff -->
        <pathelement location="${build.deprecated}" />
        <pathelement location="${build.test}" />
        <fileset dir="${tools.lib}">
          <include name="*.jar"/>
        </fileset>
      </path>
  
      <!-- Compile tests -->
      <javac srcdir="${test}"
             destdir="${build.test}"
             debug="${compiler.debug}"
             optimize="${compiler.optimize}"
             deprecation="${compiler.deprecation}"
             target="${target.vm}"
             compiler="${compiler}"
             classpathref="test.classpath"/>
    </target>
  
  <!-- === Package Targets ================================================= -->
  
    <!-- packages everything -->
    <target name="package"
        depends="package-core, package-deprecated, package-testcase"/>
  
    <!-- package the core -->
    <target name="package-core" depends="compile-core, block-roles">
      <jar jarfile="${build}/${name}.jar" manifest="${java}/Manifest.mf" index="true">
        <fileset dir="${build.dest}">
           <exclude name="**/Manifest.mf"/>
        </fileset>
      </jar>
    </target>
  
    <!-- package deprecated code -->
    <target name="package-deprecated" depends="compile-deprecated"
        unless="internal.exclude.deprecated">
      <jar jarfile="${build}/${name}-deprecated.jar" index="true">
        <fileset dir="${build.deprecated}"/>
      </jar>
    </target>
  
    <!-- package testcase code -->
    <target name="package-testcase" depends="compile-tests">
      <jar jarfile="${build}/${name}-testcase.jar" index="true">
        <fileset dir="${build.test}">
          <include name="org/apache/cocoon/environment/mock/*"/>
          <include name="org/apache/cocoon/components/source/SourceResolverAdapter*"/>
          <include name="org/apache/cocoon/SitemapComponentTestCase*"/>
          <include name="org/apache/cocoon/xml/WhitespaceFilter*"/>
        </fileset>
      </jar>
    </target>
  
  <!-- === Block Targets =================================================== -->
  
    <!-- prepares the blocks build -->
    <target name="prepare-blocks" depends="prepare">
      <mkdir dir="${build.blocks}"/>
  
      <xslt in="${gump.descriptor}"
            out="${build.temp}/blocks-build.xml"
            processor="trax"
            style="${tools.src}/blocks-build.xsl"/>
    </target>
  
    <!-- patch the cocoon role file -->
    <target name="block-roles" depends="prepare-blocks">
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="roles"/>
    </target>
  
    <!-- compiles and packages all blocks -->
    <target name="blocks" depends="compile,prepare-blocks">
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="compile"/>
    </target>
  
    <target name="call-block-target" depends="prepare">
      <ant antfile="${build.temp}/blocks-build.xml" 
           inheritAll="true" 
           inheritRefs="false" 
           target="cocoon-block-${block.name}-${target.name}" />
    </target>
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/dist-build.xml
  
  Index: dist-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="dist">
  
    <description>
      Distribution targets
    </description>
  
    <target name="dist" depends="init" description="[admin] Builds the distribution">
  
      <mkdir dir="${dist.root}"/>
      <mkdir dir="${dist}"/>
  
      <copy todir="${dist}/tools">
        <fileset dir="${tools}">
          <exclude name="anttasks/**"/>
          <exclude name="loader/**"/>
          <exclude name="lib/xalan*"/> 
          <exclude name="lib/xerces*"/> 
          <exclude name="lib/jtidy*"/> 
          <exclude name="lib/xml-apis.jar"/> 
        </fileset>
      </copy>
      
      <copy todir="${dist}/lib">
        <fileset dir="${lib}"/>
      </copy>
  
      <copy todir="${dist}/src">
        <fileset dir="${src}"/>
      </copy>
  
      <copy todir="${dist}/legal">
        <fileset dir="${legal}"/>
      </copy>
  
      <copy todir="${dist}" filtering="on">
       <fileset dir=".">
        <include name="README.txt"/>
        <include name="INSTALL.txt"/>
        <include name="CREDITS.txt"/>
        <include name="DESKTOP.INI"/>
        <include name="*.bat"/>
        <include name="*.sh"/>
        <include name="KEYS"/>
        <include name="*.xml"/>
        <include name="*.properties"/>
        <include name="*.xconf"/>
        <exclude name="local.*"/>
        <exclude name="announcement.xml"/>
       </fileset>
      </copy>
  
      <chmod perm="+x" file="${dist}/cocoon.sh"/>
      <chmod perm="+x" file="${dist}/build.sh"/>
      <chmod perm="+x" file="${dist}/tools/bin/antRun"/>
      <fixcrlf srcdir="${dist}" includes="**.sh" eol="lf"/>
      <fixcrlf srcdir="${dist}" includes="antRun" eol="lf"/>
      <fixcrlf srcdir="${dist}" includes="**.bat" eol="crlf"/>
  
      <zip zipfile="${dist.target}/${dist.name}-src.zip" 
           basedir="${dist.root}" 
           includes="${dist.name}/**">
      </zip>
  
      <tar tarfile="${dist.target}/${dist.name}-src.tar" 
           longfile="gnu">
           <tarfileset dir="${dist.root}">
               <include name="${dist.name}/**"/>
               <exclude name="${dist.name}/cocoon.sh"/>
               <exclude name="${dist.name}/build.sh"/>
               <exclude name="${dist.name}/tools/bin/antRun"/>
           </tarfileset>
           <tarfileset dir="${dist.root}" mode="755">
               <include name="${dist.name}/cocoon.sh"/>
               <include name="${dist.name}/build.sh"/>
               <include name="${dist.name}/tools/bin/antRun"/>
           </tarfileset>
      </tar>
      <gzip zipfile="${dist.target}/${dist.name}-src.tar.gz" src="${dist.target}/${dist.name}-src.tar"/>
      <delete file="${dist.target}/${dist.name}-src.tar"/>
    </target>
    
    <target name="clean-dist" depends="clean" description="Cleans everything and brings back to original 'CVS checkout' state">
      <delete dir="${build.root}"/>
      <delete dir="${tools.tasks.dest}"/>
      <delete dir="${tools.loader.dest}"/>
      <delete file="${dist.target}/${dist.name}-src.tar.gz"/>
      <delete file="${dist.target}/${dist.name}-src.zip"/>
      <delete dir="${dist.root}"/>
    </target>
    
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/docs-build.xml
  
  Index: docs-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="docs">
  
    <description>
      Documentation Targets
    </description>
    
    <target name="prepare-docs" unless="exclude.documentation" depends="blocks">
  
      <!-- Set classpath for documentation -->
      <path id="documentation.classpath">
        <path refid="classpath"/>
        <fileset dir="${build.blocks}">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${blocks}">
          <include name="*/lib/*.jar"/>
        </fileset>
        <path location="${tools.jar}"/>
        <path location="${build.context}/WEB-INF/classes"/>
      </path>
  
      <mkdir dir="${build.context}"/>
      <mkdir dir="${build.context}/images"/>
  
      <!-- make filtered copy of XML docs -->
      <copy todir="${build.context}" filtering="on">
        <fileset dir="${documentation}">
          <exclude name="images/**"/>
        </fileset>
      </copy>
  
      <!-- Add some other documents -->
      <copy file="status.xml"
        tofile="${build.context}/xdocs/status.xml" filtering="on"/>
  
  	<!-- generate sitemap components docs 
      <sitemap-components docDir="${build.context}/xdocs/userdocs" source="${java}"/>
      -->
      
      <!-- Forrest needs its own file at src/documentation/sitemap.xmap, so we
      overwrite it with the old Cocoon-specific sitemap here -->
      <move file="${build.context}/sitemap-localdocs.xmap"
        tofile="${build.context}/sitemap.xmap"/>
  
      <!-- Copy images -->
      <copy todir="${build.context}/images" filtering="off">
        <fileset dir="${documentation}/images"/>
      </copy>
  
      <!-- Copy entity catalog and entities -->
      <copy todir="${build.context}/WEB-INF/entities" filtering="on">
        <fileset dir="${webapp}/WEB-INF/entities"/>
      </copy>
      <copy todir="${build.context}/WEB-INF/classes" filtering="on">
        <fileset dir="${webapp}/WEB-INF/classes"/>
      </copy>
  
      <!-- Copy the logkit configuration -->
      <copy todir="${build.context}" filtering="on" file="${webapp}/WEB-INF/logkit.xconf"/>
  
    </target>
  
    <!-- Set a variable if the generated docs are already up-to-date. -->
    <target name="docs_check" depends="prepare-docs">
      <uptodate property="docs.notrequired" targetfile="${build.docs}/index.html" >
        <srcfiles dir="." includes="status.xml"/>
        <srcfiles dir="${build}" includes="jars.xml"/>
        <srcfiles dir="${documentation}/xdocs" includes="**/*.xml"/>
      </uptodate>
    </target>
  
    <!-- If generated docs are already up-to-date, print a message saying so. -->
    <target name="docs_done" depends="docs_check" if="docs.notrequired">
      <echo>-------------------------------------------------------------
  Not rebuilding docs, as they are up-to-date:
    ${build.docs}/index.html is more recent than
    status.xml, ${documentation}/xdocs/*.xml
  -------------------------------------------------------------
  </echo>
    </target>
  
    <!-- Create docs -->
    <target name="docs"
        depends="validate-jars, prepare-docs, validate-xdocs, docs_done, javadocs, forrest"
        unless="docs.notrequired" description="Builds the documentation">
      <!-- The docs are created using forrest, so we simply copy them for now -->
      <mkdir dir="${build.docs}"/>
  
      <copy todir="${build.docs}" filtering="off">
        <fileset dir="${build.site}"/>
      </copy>
      <copy todir="${build.docs}/apidocs" filtering="off">
        <fileset dir="${build.javadocs}"/>
      </copy>
    </target>
  
    <!-- Prepares the printer-docs -->
  <!--
    <target name="prepare-printer-docs" depends="prepare-docs">
      <mkdir dir="${build.context.printer}"/>
  -->
      <!-- copy prepared docs -->
  <!--
      <copy todir="${build.context.printer}" filtering="off">
        <fileset dir="${build.context}"/>
      </copy>
  -->
      <!-- copy printer skin -->
  <!--
      <copy todir="${build.context.printer}/stylesheets" filtering="off" overwrite="yes">
        <fileset dir="${build.context}/stylesheets/printer_skin"/>
      </copy>
    </target>
  -->
    <!-- Set a variable if the generated printer docs are already up-to-date. -->
  <!--
    <target name="printer-docs_check" depends="prepare">
      <uptodate property="printer-docs.notrequired" targetfile="${build.docs.printer}/index.html" >
        <srcfiles dir="." includes="status.xml"/>
        <srcfiles dir="${docs}" includes="**/*.xml"/>
      </uptodate>
    </target>
  -->
    <!-- If generated printer docs are already up-to-date, print a message saying so. -->
  <!--
    <target name="printer-docs_done" depends="printer-docs_check" if="printer-docs.notrequired">
      <echo message="Not rebuilding printer docs, as they are up-to-date:"/>
      <echo message="  ${build.docs.printer}/index.html is more recent than"/>
      <echo message="  status.xml, ${docs}/*.xml"/>
    </target>
  -->
    <!-- Create printer friendly docs -->
  <!--
    <target name="printer-docs" depends="prepare-printer-docs, validate-xdocs, printer-docs_done" description="Builds printer-friendly documentation">
      <mkdir dir="${build.docs.printer}"/>
  
      <java classname="org.apache.cocoon.Main" fork="true" dir="${build.context.printer}" failonerror="true" maxmemory="128m">
        <arg value="-c."/>
        <arg value="-d../printer-docs"/>
        <arg value="-w../temp/printer"/>
        <arg value="-b../brokenlinks.txt"/>
        <arg value="-k./logkit.xconf"/>
        <arg value="-u${build.docs.printer.loglevel}"/>
        <arg value="-V"/>
        <arg value="index.html"/>
        <classpath>
          <path refid="documentation.classpath"/>
        </classpath>
      </java>
    </target>
  -->
  <!-- === Javadoc ============================================================= -->
  
    <!-- Check if javadocs have to be generated -->
    <!-- Obsolete:
    <target name="javadocs-check">
      <mkdir dir="${build.javadocs}"/>
      <condition property="javadocs.notrequired" value="true">
       <or>
        <uptodate targetfile="${build.javadocs}/packages.html" >
         <srcfiles dir= "${java}" includes="**/*.java,**/package.html"/>
         <srcfiles dir= "${deprecated.src}" includes="**/*.java,**/package.html"/>
        </uptodate>
        <istrue value="${internal.exclude.javadocs}"/>
       </or>
      </condition>
    </target>
    -->
    <!-- Creates Javadocs -->
    <!-- Obsolete:
    <target name="javadocs" depends="prepare, javadocs-check" unless="javadocs.notrequired" description="Builds the API documentation (javadocs)">
  
      <condition property="javadoc.additionalparam" value="-breakiterator -tag todo:all:Todo:">
        <equals arg1="1.4" arg2="${ant.java.version}"/>
      </condition>
      <condition property="javadoc.additionalparam" value="">
        <not><equals arg1="1.4" arg2="${ant.java.version}"/></not>
      </condition>
  
      <javadoc destdir="${build.javadocs}"
               author="true"
               version="true"
               use="true"
               noindex="false"
               splitindex="true"
               windowtitle="${Name} API ${version} [${TODAY}]"
               doctitle="${Name} API ${version}"
               bottom="Copyright &#169; ${year} Apache Software Foundation. All Rights Reserved."
               stylesheetfile="${resources.javadoc}/javadoc.css"
               useexternalfile="yes"
               additionalparam="${javadoc.additionalparam}">
  
        <link offline="true" href="http://avalon.apache.org/api"                  packagelistloc="${resources.javadoc}/avalon"/>
        <link offline="true" href="http://xml.apache.org/xerces2-j/javadocs/api"  packagelistloc="${resources.javadoc}/xerces"/>
        <link offline="true" href="http://xml.apache.org/xalan-j/apidocs"         packagelistloc="${resources.javadoc}/xalan"/>
        <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api"       packagelistloc="${resources.javadoc}/j2se"/>
        <link offline="true" href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api" packagelistloc="${resources.javadoc}/j2ee"/>
  
        <packageset dir="${java}">
          <include name="**"/>
        </packageset>
        <packageset dir="${deprecated.src}">
          <include name="**"/>
        </packageset>
        <classpath refid="classpath"/>
      </javadoc>
  
    </target>
    -->
    
    <!-- Creates Javadocs -->
    <target name="javadocs" 
            depends="prepare-blocks"
            description="Builds the API documentation (javadocs)">
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="javadocs"/>
    </target>
  
    <!-- Creates Javadocs for published classes/interfaces only-->
    <target name="published-api" 
            depends="prepare-blocks"
            description="Builds the published API documentation (javadocs)">
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="published-api"/>
    </target>
    
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/forrest-build.xml
  
  Index: forrest-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="forrest">
  
    <description>
      Forrest Targets
    </description>
  
    <target name="forrest" depends="prepare, prepare-docs, forrest.init, validate-jars, javadocs" description="Generates static HTML documentation">
      <!-- Add some other documents -->
      <copy file="${build.temp}/jars.xml"
        tofile="${build.context}/xdocs/installing/jars.xml" filtering="off"
        overwrite="yes"/>
  
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site"/>
    </target>
  
    <!-- Generates an unpackaged webapp of the website -->
    <target name="forrest.webapp" depends="forrest.init">
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="webapp"/>
    </target>
  
    <!-- Generates a .war file containing the website -->
    <target name="forrest.war" depends="forrest.init">
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="war"/>
    </target>
  
    <!-- Validates XML documentation files -->
    <target name="forrest.validate" depends="forrest.init">
      <ant antfile="${forrest.home}/forrest.antproxy.xml" target="validate"/>
    </target>
  
    <target name="forrest.init" depends="forrest.sethome, forrest.home.defined"/>
  
    <target name="forrest.sethome" depends="forrest.loadenv,
    forrest.checkenv, forrest.checkhome, forrest.check-build.properties,
    forrest.check-project.properties, forrest.check-ant.properties,
    forrest.check-.ant.properties"/>
  
    <target name="forrest.loadenv" unless="forrest.home.present">
      <property environment="env"/>
      <echo level="verbose">Forrest: Got ${env.FORREST_HOME}</echo>
    </target>
  
    <target name="forrest.checkenv" if="env.FORREST_HOME">
      <echo level="verbose">Found $FORREST_HOME=${env.FORREST_HOME}</echo>
      <property name="forrest.home" location="${env.FORREST_HOME}"/>
      <echo level="verbose">forrest.home set to ${forrest.home}</echo>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
  
    <target name="forrest.checkhome">
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
      <available file="build.properties" type="file" property="build.properties.present"/>
      <available file="project.properties" type="file" property="project.properties.present"/>
      <available file="ant.properties" type="file" property="ant.properties.present"/>
      <available file=".ant.properties" type="file" property=".ant.properties.present"/>
  
      <echo message="forrest.home.present=${forrest.home.present}"/>
      <echo message="build.properties.present=${build.properties.present}"/>
    </target>
  
    <!-- No we can't extract the commonalities below into an antcall'ed target,
    because it wouldn't be able to set forrest.home -->
    <target name="forrest.check-build.properties" unless="forrest.home.present"
    if="build.properties.present">
      <echo level="verbose">Forrest: Checking build.properties..</echo>
      <loadproperties srcfile="build.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
  
    </target>
  
    <target name="forrest.check-project.properties" unless="forrest.home.present"
    if="project.properties.present">
      <echo level="verbose">Forrest: Checking project.properties..</echo>
      <loadproperties srcfile="project.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
    <target name="forrest.check-ant.properties" unless="forrest.home.present"
    if="ant.properties.present">
      <echo level="verbose">Forrest: Checking ant.properties..</echo>
      <loadproperties srcfile="ant.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
    <target name="forrest.check-.ant.properties" unless="forrest.home.present"
    if=".ant.properties.present">
      <echo level="verbose">Forrest: Checking .ant.properties..</echo>
      <loadproperties srcfile=".ant.properties">
        <filterchain>
          <linecontains>
            <contains value="forrest.home"/>
          </linecontains>
        </filterchain>
      </loadproperties>
      <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
    </target>
  
    <target name="forrest.home.defined" depends="forrest.sethome" unless="forrest.home.present">
      <property name="path" value="${user.home}/xml-forrest/build/dist/shbat"/>
      <pathconvert targetos="windows" property="winpath">
        <path>
          <pathelement location="${path}"/>
        </path>
      </pathconvert>
      <pathconvert targetos="unix" property="unixpath">
        <path>
          <pathelement
            location="${path}"/>
        </path>
      </pathconvert>
  
      <echo>
        ----------------------------------------------
        To run this target, you need Forrest installed.
        Please do the following:
  
        export CVSROOT=:pserver:anoncvs@cvs.apache.org:/home/cvspublic
        cvs checkout xml-forrest
        cd xml-forrest
        build      (Windows)
        ./build.sh (Unix)
  
        Then either:
  
        - Set FORREST_HOME as the Forrest build instructions describe
        - Create a project.properties, with the forrest.home property
          pointing to the forrest shbat directory, e.g.
  
          forrest.home=${winpath}  (Windows)
          forrest.home=${unixpath}  (Unix)
  
          (adjusting the path according to where your xml-forrest is)
        ----------------------------------------------
      </echo>
      <fail message="Need to define $${forrest.home}"/>
    </target>
  
  </project>
  
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/ide-build.xml
  
  Index: ide-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="ide">
    
    <description>
      IDE targets
    </description>
  
    <!-- Generate the Emacs JDE project file -->
    <target name="emacs-project" depends="prepare" description="Generate the Emacs project files">
      <path id="jar.files">
        <fileset dir="${build.webapp}/WEB-INF/lib">
          <include name="*.jar"/>
        </fileset>
        <pathelement path="${build.context}/WEB-INF/classes"/>
      </path>
      <property name="jar.files" refid="jar.files"/>
      <copy file="${tools}/ide/emacs/prj.el.in" tofile="prj.el" filtering="yes">
        <filterset>
          <filter token="jar.files" value="${jar.files}"/>
          <filter token="src" value="${java}"/>
          <filter token="build.webapp" value="${build.webapp}"/>
        </filterset>
      </copy>
    </target>
  
    <!-- Build the Eclipse projects files -->
    <target name="eclipse-project" depends="prepare" description="Generate the Eclipse project files">
  
      <echo message="Building Eclipse Project Files"/>
  
      <!-- prepare the various paths that will form the project -->
      <path id="srcs">
        <!-- main source dir -->
        <pathelement path="${src}/java"/>
        <!-- samples source dir -->
        <pathelement path="${src}/samples"/>
        <!-- deprecated source dir -->
        <pathelement path="${src}/deprecated/java"/>
        <!-- test source dir -->
        <pathelement path="${src}/test"/>
        <!-- blocks source dirs -->
        <dirset dir="${blocks}">
          <include name="*/java"/>
          <include name="*/java${target.vm}"/>
        </dirset>
      </path>
  
      <path id="mockss">
        <dirset dir="${src}">
          <include name="**/mocks"/>
        </dirset>
      </path>
  
      <path id="libs">
        <!-- main libs -->
        <fileset dir="${lib}">
          <include name="core/*.jar"/>
          <!-- Currently, we have no JVM dependent libraries       
            <include name="core/jvm${target.vm}/*.jar"/>
          -->
          <include name="optional/*.jar"/>
          <include name="local/*.jar"/>
          <include name="endorsed/*.jar"/>
        </fileset>
        <!-- blocks lib -->
        <fileset dir="${blocks}">
          <include name="**/*.jar"/>
        </fileset>
        <!-- tools libs -->
        <fileset dir="${tools}/lib">
          <include name="*.jar"/>
        </fileset>      
      </path>
  
      <!-- convert paths to properties -->
      <property name="srcs" refid="srcs"/>
      <property name="mockss" refid="mockss"/>
      <property name="libs" refid="libs"/>
  
      <!-- expand properties in the template file -->
      <copy file="${tools}/ide/eclipse/classpath-tmpl.xml"
            tofile="${build.temp}/classpath-temp.xml"
            filtering="yes"
            overwrite="yes">
        <filterset>
          <filter token="SRC_DIRS" value="${srcs}"/>
          <filter token="LIBS" value="${libs}"/>
          <filter token="MOCKS_DIRS" value="${mockss}"/>
          <filter token="OUTPUT_DIR" value="${ide.eclipse.outputdir}"/>
        </filterset>
      </copy>
  
      <!-- split the path in 'item' XML elements -->
      <replace file="${build.temp}/classpath-temp.xml"
               token="${path.separator}" value="&lt;/item&gt;&#xA; &lt;item&gt;"/>
      <!-- relativize file names by removing the current directory -->
      <replace file="${build.temp}/classpath-temp.xml"
               token="${user}${file.separator}" value=""/>
      <!-- and in case that fails, remove the base directory -->
      <replace file="${build.temp}/classpath-temp.xml"
               token="${basedir}${file.separator}" value=""/>
  
      <!-- replace platform-dependent path separator by '/' -->
      <replace file="${build.temp}/classpath-temp.xml"
               token="${file.separator}" value="/"/>
  
      <!-- now build the .classpath file -->
      <xslt in="${build.temp}/classpath-temp.xml" out="${basedir}/.classpath"
            processor="trax"
            style="${tools}/ide/eclipse/make-classpath.xsl">
         <param name="exportlib" expression="${ide.eclipse.export.libs}"/>
      </xslt>
  
      <!-- copy the project file (expand version) -->
      <copy file="${tools}/ide/eclipse/project"
            tofile="${basedir}/.project"
            overwrite="yes">
        <filterset>
          <filter token="VERSION" value="${version}"/>
        </filterset>
      </copy>
    </target>
  
    <!-- Prepares the webapp to make it directly usable with the eclipse project -->
    <target name="eclipse-webapp-prepare" depends="eclipse-webapp-delete-jars, eclipse-webapp-restore-roles"
            description="Prepares the webapp directory to make it usable within Eclipse"/>
  
    <target name="eclipse-webapp-restore-roles" depends="prepare">
        <copy file="${build.dest}/org/apache/cocoon/cocoon.roles"
              tofile="${build.webapp}/WEB-INF/classes/org/apache/cocoon/cocoon.roles"
              overwrite="yes"/>
    </target>
    
    <target name="eclipse-webapp-delete-jars" depends="prepare">
        <!-- delete all jars and class files, they are already included in the project -->
        <delete>
            <fileset dir="${build.webapp}/WEB-INF">
              <include name="lib/*.jar" />
              <include name="classes/**/*.class" />
            </fileset>
        </delete>
    </target>
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/init-build.xml
  
  Index: init-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="init">
  
    <description>
      Initialization Targets
    </description>
  
    <target name="init">
  
      <!-- Set the timestamps -->
      <tstamp/>
  
      <!-- Get the (constant) cocoon properties -->
      <property file="src/java/org/apache/cocoon/cocoon.properties"/>
  
      <!-- Detecting the current jvm -->
      <condition property="target.vm" value="1.5">
        <equals arg1="1.5" arg2="${ant.java.version}"/>
      </condition>
      <condition property="target.vm" value="1.4">
        <equals arg1="1.4" arg2="${ant.java.version}"/>
      </condition>
      <condition property="target.vm" value="1.3">
        <not>
          <or>
            <equals arg1="1.4" arg2="${ant.java.version}"/>
            <equals arg1="1.5" arg2="${ant.java.version}"/>
          </or>
        </not>
      </condition>
  
      <!-- The location of tools.jar, relative to the JAVA_HOME home. -->
      <property name="tools.jar" value="${java.home}/../lib/tools.jar"/>
      <available file="${tools.jar}" property="tools.jar.present"/>
  
      <!-- Allow users a chance to override without editing the main file -->
      <property file="${user.home}/cocoon.build.properties"/>
      <property file="local.build.properties"/>
  
      <!-- Get the build properties from an external file -->
      <property file="build.properties"/>
  
      <!-- Allow users a chance to override without editing the main file -->
      <property file="${user.home}/cocoon.blocks.properties"/>
      <property file="local.blocks.properties"/>
  
      <!-- Get the block properties from an external file -->
      <property file="blocks.properties"/>
  
      <!-- Use internal.exclude.XXX shadow props used in the
        unless target attributes -->
      <condition property="internal.exclude.webapp.documentation">
        <istrue value="${exclude.webapp.documentation}"/>
      </condition>
      <condition property="internal.exclude.webapp.javadocs">
        <or>
          <istrue value="${exclude.javadocs}"/>
          <istrue value="${exclude.webapp.javadocs}"/>
        </or>
      </condition>
      <condition property="internal.exclude.webapp.samples">
        <istrue value="${exclude.webapp.samples}"/>
      </condition>
  
      <condition property="internal.exclude.deprecated">
        <istrue value="${exclude.deprecated}"/>
      </condition>
      <condition property="internal.exclude.javadocs">
        <istrue value="${exclude.javadocs}"/>
      </condition>
      <condition property="internal.exclude.validate.jars">
        <istrue value="${exclude.validate.jars}"/>
      </condition>
      <condition property="internal.exclude.validate.config">
        <istrue value="${exclude.validate.config}"/>
      </condition>
      <condition property="internal.exclude.validate.xdocs">
        <or>
          <istrue value="${exclude.validate.xdocs}"/>
          <istrue value="${exclude.documentation}"/>
        </or>
      </condition>
  
      <filter token="Name"                value="${fullname}"/>
      <filter token="name"                value="${fullname}"/>
      <filter token="year"                value="${year}"/>
      <filter token="version"             value="${version}"/>
      <filter token="date"                value="${TODAY}"/>
      <filter token="released.version"    value="${released.version}"/>
      <filter token="loglevel"            value="${build.webapp.loglevel}"/>
  
      <!-- Alias for the loglevel -->
      <property name="loglevel" value="${build.webapp.loglevel}"/>
      
      <!-- Set classpath -->
      <path id="classpath">
        <fileset dir="${lib.local}">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib}">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.endorsed}">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.core}">
          <include name="*.jar"/>
        </fileset>
        <!-- Currently, we have no JVM dependent libraries 
          <fileset dir="${lib.core}/jvm${target.vm}">
            <include name="*.jar"/>
          </fileset>
        -->
        <fileset dir="${lib.optional}">
          <include name="*.jar"/>
        </fileset>
        <path location="${build.mocks}"/>
        <path location="${build.dest}"/>
      </path>
  
    </target>
  
    <target name="init-tasks" depends="init">
  
      <!-- Set classpath for building ant tasks -->
      <path id="tasks.classpath">
        <path refid="classpath"/>
        <fileset dir="${tools.lib}">
          <include name="*.jar"/>
        </fileset>
        <path location="${tools.tasks.dest}"/>
      </path>
  
      <!-- compile the ant tasks -->
      <mkdir dir="${tools.tasks.dest}"/>
      <javac srcdir="${tools.tasks.src}"
             destdir="${tools.tasks.dest}"
             debug="off"
             optimize="on"
             deprecation="on"
             target="1.3"
             nowarn="on"
             compiler="${compiler}"
             classpathref="tasks.classpath"/>
  
      <!-- A task to patch xml files -->
      <taskdef name="xpatch" classname="XConfToolTask"
             classpath="${tools.tasks.dest}"/>
  
      <!-- A task for sitemap components -->
      <taskdef name="sitemap-components" 
              classname="SitemapTask"
              classpathref="tasks.classpath"/>
  
      <!-- Jing is used in various targets for XML validation with RELAX NG -->
      <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"
             classpathref="tasks.classpath"/>
  
      <!-- A task for generating javadocs only for published classes/interfaces -->
      <taskdef name="pubapidocs" classname="doclets.QdoxJavadocTask" classpathref="tasks.classpath"/>
  
      <!-- compile the loader, used to change classpath especially for
             the CLI and Jetty -->
      <mkdir dir="${tools.loader.dest}"/>
      <javac srcdir="${tools.loader.src}"
             destdir="${tools.loader.dest}"
             debug="off"
             optimize="on"
             deprecation="on"
             target="1.3"
             nowarn="on"
             compiler="${compiler}"/>
  
      <!-- Ant-Contrib tasks -->
      <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
    </target>
  
  <!-- === Preparation Targets ============================================= -->
  
    <!-- Prepare the build directory -->
    <target name="prepare" depends="init-tasks">
      <echo>======================================================================
                   ${fullname} ${version} [${year}]
  ======================================================================
   Building with ${ant.version}
  ----------------------------------------------------------------------
   Using build file ${ant.file}
  ----------------------------------------------------------------------
   Compiler options:
     - debug ......... [${compiler.debug}]
     - optimize ...... [${compiler.optimize}]
     - deprecation ... [${compiler.deprecation}]
  ======================================================================</echo>
      <mkdir dir="${build}"/>
    </target>
  
  <!-- === Clean Targets =================================================== -->
  
    <!-- Clean -->
    <target name="clean"
           depends="clean-cocoon,clean-webapp,clean-standalone-demo"
           description="Cleans the cocoon build, webapp and standalone-demo"/>
  
    <!-- Clean the cocoon build directory -->
    <target name="clean-cocoon" depends="init" description="Cleans the cocoon build">
      <delete dir="${build}"/>
    </target>
  
    <!-- Clean the webapp -->
    <target name="clean-webapp" depends="init" description="Cleans the webapp">
      <delete dir="${build.webapp}"/>
    </target>
  
    <!-- Clean the standalone demo -->
    <target name="clean-standalone-demo" depends="init" description="Cleans the standalone-demo">
      <delete dir="${build.standalone.demo}"/>
    </target>
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/instrumentation-build.xml
  
  Index: instrumentation-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="instrumentation">
    <target name="start-instrumentation-client" depends="init">
      <property name="lib.instrumentation" value="tools/instrumentation/lib"/>
  
      <echo>The version of the altrmi server libraries in ${lib.optional} must correspond
  to the version of the altrmi client libraries in ${lib.instrumentation}.
  </echo>
  
      <java classname="org.apache.excalibur.instrument.client.Main" fork="true">
        <classpath>
          <fileset dir="${lib.core}">
            <include name="avalon-framework-*.jar"/>
            <include name="excalibur-instrument-manager-interfaces-*.jar"/>
          </fileset>
          <fileset dir="${lib.optional}">
            <include name="altrmi-common-*.jar"/>
          </fileset>
          <fileset dir="${lib.instrumentation}">
            <include name="excalibur-instrument-client-*.jar"/>
            <include name="altrmi-*.jar"/>
          </fileset>
        </classpath>
      </java>
    </target>
  </project>
  
  
  1.1                  cocoon-2.1/tools/new-targets/samples-build.xml
  
  Index: samples-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  
  <project name="samples">
  
    <description>
      Samples Targets
    </description>
  
    <target name="samples" depends="prepare" unless="internal.exclude.webapp.samples">
      <mkdir dir="${build.samples}"/>
  
      <javac srcdir="${samples}"
             destdir="${build.samples}"
             debug="${compiler.debug}"
             optimize="${compiler.optimize}"
             deprecation="${compiler.deprecation}"
             target="${target.vm}"
             compiler="${compiler}"
             classpathref="classpath"/>
  
      <!-- copy sample files -->
      <copy todir="${build.webapp.samples}" filtering="on">
        <fileset dir="${webapp.samples}">
          <exclude name="samples.xwelcome"/>
          <exclude name="old_sitemap.xmap"/>
          <exclude name="**/*.jpg"/>
          <exclude name="**/*.gif"/>
          <exclude name="**/*.png"/>
          <!-- filtering breaks UTF-8 files -->
          <exclude name="i18n/**"/> 
          <exclude name="hello-world/style/xsl/**"/>
        </fileset>
      </copy>
  
      <copy todir="${build.webapp.samples}" filtering="off">
        <fileset dir="${webapp.samples}">
          <include name="**/*.jpg"/>
          <include name="**/*.gif"/>
          <include name="**/*.png"/>
          <include name="i18n/**"/>
          <include name="hello-world/style/xsl/**"/>
        </fileset>
      </copy>
  
      <!-- copy gump.xml which is used to create block samples page -->
      <copy file="gump.xml" todir="${build.webapp.samples}/blocks"/>
  
      <!-- copy sample classes -->
      <copy todir="${build.webapp.classes}" filtering="off">
        <fileset dir="${build.samples}"/>
      </copy>
  
      <!-- patch the welcome page to tell we have samples to show -->
      <xpatch file="${build.webapp}/welcome.xml"
              srcdir="${webapp.samples}" 
              includes="**/*.xwelcome"/>
    </target>
  
    <target name="block-samples" depends="prepare" unless="internal.exclude.webapp.samples">
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="samples"/>
    </target>
  </project>  
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/standalone-demo-build.xml
  
  Index: standalone-demo-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="standalone">
  <!--
      ant include file for "standalone-demo" build
      @author bdelacretaz@codeconsult.ch
  
      $Id: standalone-demo-build.xml,v 1.1 2004/05/26 10:04:33 nicolaken Exp $
   -->
  
  <target name="standalone-demo" depends="init, webapp" description="build webapp and copy files for standalone demo">
  
      <!-- setup -->
      <mkdir dir="${build.standalone.demo}"/>
      <property name="readme.txt" value="${build.standalone.demo}/readme-standalone.txt"/>
  
      <!-- copy files that cocoon.sh needs to run so that they can be moved out of the build tree easily -->
      <copy todir="${build.standalone.demo}">
          <fileset dir=".">
              <include name="${lib.endorsed}/**"/>
              <include name="${tools.loader.dest}/**"/>
              <include name="${tools.jetty}/**"/>
              <include name="cocoon.sh"/>
              <include name="cocoon.bat"/>
          </fileset>
      </copy>
  
      <!-- fix permissions and line endings -->
      <chmod perm="+x" file="${build.standalone.demo}/cocoon.sh"/>
      <fixcrlf srcdir="${build.standalone.demo}" includes="**.sh" eol="lf"/>
      <fixcrlf srcdir="${build.standalone.demo}" includes="**.bat" eol="crlf"/>
  
      <!-- create readme.txt for users -->
      <echo file="${readme.txt}">
  Cocoon standalone-demo
  ----------------------
  After building this version with "build standalone-demo" from the main Cocoon distribution
  directory, copying the ${build.standalone.demo} and ${build.webapp} directories
  somewhere else provides you with a simple standalone Cocoon installation, meant for
  test and demo purposes.
  
  To start this standalone demo use either "./cocoon.sh servlet" or "cocoon.bat servlet" in the
  standalone-demo directory.
  
  The webapp directory must be found as "../webapp" for this to work:
  
          common-parent-directory
                  |
                  +----------- standalone-demo
                  +----------- webapp
  
  Note that the version of the jetty servlet engine that is included with this demo
  is not the full version. For production uses, we recommend that you get a complete
  servlet engine and install it according to your needs.
  
  Have fun!
  Your friendly neighbourhood Cocoon team.
  </echo>
  
      <!-- all done -->
      <echo>--- standalone-demo build ready! -----------------------------------------
  See ${readme.txt} for more info.
  --------------------------------------------------------------------------
      </echo>
  
  </target>
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/test-build.xml
  
  Index: test-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="test">
  
    <description>
      Test targets
    </description>
  
    <!-- Runs all tests -->
    <target name="test" depends="junit-tests, block-tests" description="Runs all JUnit tests (but no anteater tests)"/>
  
    <target name="junit-prepare">
      <delete dir="${build.test.output}"/>
      <mkdir dir="${build.test.output}"/>
    </target>
  
    <!-- Runs JUnit tests -->
    <target name="junit-tests" depends="compile-tests, junit-prepare">
      <junit printsummary="yes" fork="yes" failureproperty="junit.test.failed">
        <classpath>
          <path refid="test.classpath"/>
        </classpath>
        <formatter type="plain"/>
        <formatter type="xml"/>
        <batchtest todir="${build.test.output}">
          <fileset dir="${build.test}">
            <include name="**/*TestCase.class"/>
            <include name="**/*Test.class" />
            <exclude name="**/AllTest.class" />
            <exclude name="**/CocoonBeanTestCase.class" />
            <exclude name="**/*$$*Test.class" />
            <exclude name="**/Abstract*.class" />
            <exclude name="**/SitemapComponentTestCase*"/>
          </fileset>
        </batchtest>
      </junit>
      <antcall target="junit-report"/>
    </target>
  
    <!-- Runs JUnit tests in debug mode -->
    <target name="junit-test-debug" depends="compile-tests, junit-prepare">
      <fail unless="junit.testcase" message="Please set the property $${junit.testcase} to a JUnit testcase (package.Classname, e.g. org.test.MyTestCase)."/>
      <echo message="The JVM will be suspended until you connect with your favourite debugger to port ${junit.test.debugport}."/>
      <junit printsummary="yes" fork="yes" failureproperty="junit.test.failed">
        <jvmarg value="-Xdebug"/>
        <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${junit.test.debugport}"/>
        <classpath refid="test.classpath"/>
        <formatter type="plain"/>
        <formatter type="xml"/>
        <test name="${junit.testcase}" todir="${build.test.output}"/>
      </junit>
      <antcall target="junit-report"/>
    </target>
  
    <target name="junit-report">
      <junitreport todir="${build.test.output}">
        <fileset dir="${build.test.output}">
         <include name="TEST-*.xml"/>
        </fileset>
        <report format="frames" todir="${build.test.output}"/>
      </junitreport>
      <echo message="Unit report is at ${build.test.output}/index.html"/>
      <fail if="junit.test.failed" message="One or more JUnit tests failed or caused errors. Please have a look into the report for details."/>
    </target>
  
    <!-- Anteater tests  -->
    <target name="anteater-tests" depends="compile-tests,block-anteater-tests" description="Runs anteater tests (but no JUnit tests)">
      <!-- anteater parameters are set in build.properties -->
      <available file="${anteater.home}" property="anteater.present"/>
      <fail unless="anteater.present"
            message="To use anteater, please install it and set anteater.home (currently ${anteater.home}) in your local.build.properties"/>
      <echo>*** anteater-tests notes ***************</echo>
      <echo>a) To run these tests, another instance of Cocoon must be running at ${anteater.target.host}:${anteater.target.port} (base path=${anteater.target.base.path})</echo>
      <echo>b) JDK 1.4.x is required to run these tests, but running them under 1.4.x to test Cocoon running under 1.3.x should be ok.</echo>
      <echo>c) anteater options can be set in local.build.properties, and some tests only run if enabled there.</echo>
      <java classname="org.apache.tools.ant.Main" fork="true">
        <classpath>
          <fileset dir="${anteater.home}">
            <include name="lib/**/*.jar"/>
            <include name="tomcat/**/*.jar"/>
          </fileset>
          <pathelement location="${anteater.home}/resources"/>
        </classpath>
        <jvmarg value="-Dant.home=${anteater.home}"/>
        <jvmarg value="-Danteater.home=${anteater.home}"/>
        <jvmarg value="-Danteater.resources=${anteater.home}/resources"/>
        <jvmarg value="-Danteater.report=${anteater.home}/resources/scripts/report.xml"/>
        <jvmarg value="-Djava.endorsed.dirs=${anteater.home}/lib"/>
        <arg line="-f ${build.test}/anteater/all-tests.xml -Dhost=${anteater.target.host} -Dport=${anteater.target.port} -Dbase=${anteater.target.base.path} -Ddefault.haltonerror=${anteater.option.haltonerror}"/>
      </java>
    </target>
  
    <!-- Block tests -->
    <target name="block-tests" depends="compile-tests, prepare-blocks">
  
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="tests"/>
  
    </target>
  
    <target name="block-anteater-tests" depends="prepare-blocks">
  
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="prepare-anteater-tests"/>
  
    </target>
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/tools-build.xml
  
  Index: tools-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="tools">
    <description>
      Tools provided by Ant which could be helpful
    </description>
  
    <target 
      name="correctLinefeed" 
      description="Make sure LF is used as line feed">
      
      <echo message="-------------------------------------------------------------------------------"/>
      <echo message="Make sure you don't have any binaries (except *.jpg, *.gif, *.jar and *.zip  in the directory (or any subdirectory) which you want to correct."/>
      <echo message="-------------------------------------------------------------------------------"/>
  
      <input message="Please enter the basedir which should be corrected:" addproperty="target.dir"/>
  
      <fixcrlf srcdir="${target.dir}"
         eol="lf" 
         includes="**/*"
         excludes="**/*.jpg,**/*.gif,**/*.jar,**/*.zip"
      />
        
    </target>
  
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/upgrade-build.xml
  
  Index: upgrade-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="upgrade">
    <description>
      Upgrade targets that help to convert between different Cocoon versions
    </description>
  
    <tstamp>
      <format property="timestamp" pattern="yyyyMMdd_kkmmss"/>
    </tstamp>
  
    <target
      name="Woody2CocoonForms"
      description="Updates from Woody to CocoonForms">
  
  <echo>
  -----------------------------------------------------------------------------
  Woody 2 Cocoon Forms update
  -----------------------------------------------------------------------------
  This target is now going to update your Woody files to Cocoon Forms files.
  Therefore you have to specify a source and a target dir.
  
  All .xml, .xsl, .xslt, .xmap and .js/.flow files found in the source directory
  (and any subdirectory) will be copied to the target dir and updated there. The
  source directory itself remains untouched.
  -----------------------------------------------------------------------------
  </echo>
  
      <input message="Please enter the source dir with the files that should be updated:"
             addproperty="src.dir"
             defaultvalue="./src/blocks/woody/samples"/>
      <available file="${src.dir}" type="dir" property="src.dir.exists"/>
      <fail unless="src.dir.exists" message="The entered directory doesn't exist!"/>
  
  <echo>
  -----------------------------------------------------------------------------
  For the target directory a default directory name is given, you can specify
  another one of course if you want.
  The default directory name for the target directory is:
  ./build/woody2cforms_${timestamp}
  -----------------------------------------------------------------------------
  </echo>
  
      <input message="Please enter the target directory in which the output should be stored:"
             addproperty="target.dir"
             defaultvalue="./build/woody2cforms_${timestamp}"/>
  
  <echo>
  -----------------------------------------------------------------------------
  The update process is now going to start.
  -----------------------------------------------------------------------------
  </echo>
  
      <property name="temp.dir" value="${target.dir}_temp"/>
  
      <copy todir="${target.dir}">
        <fileset dir="${src.dir}">
          <include name="**/*.xml"/>
          <include name="**/*.xsl"/>
          <include name="**/*.xslt"/>
          <include name="**/*.xmap"/>
          <include name="**/*.js"/>
          <include name="**/*.flow"/>
        </fileset>
      </copy>
  
      <!-- namespace changes from Woody to CocoonForms
           * from xmlns:wd="http://apache.org/cocoon/woody/definition/1.0"
             to   xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
           * from xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
             to   xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
           * from xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"
             to   xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
           * from xmlns:wt="http://apache.org/cocoon/woody/template/1.0"
             to   xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
      -->
      <replace dir="${target.dir}">
        <include name="**/*.xml"/>
        <include name="**/*.xsl"/>
        <include name="**/*.xslt"/>
        <replacefilter
          token="http://apache.org/cocoon/woody/instance/1.0"
          value="http://apache.org/cocoon/forms/1.0#instance"/>
        <replacefilter
          token="http://apache.org/cocoon/woody/binding/1.0"
          value="http://apache.org/cocoon/forms/1.0#binding"/>
        <replacefilter
          token="http://apache.org/cocoon/woody/template/1.0"
          value="http://apache.org/cocoon/forms/1.0#template"/>
        <replacefilter
          token="http://apache.org/cocoon/woody/definition/1.0"
          value="http://apache.org/cocoon/forms/1.0#definition"/>
        <replacefilter token="wi:" value="fi:"/>
        <replacefilter token="wb:" value="fb:"/>
        <replacefilter token="wt:" value="ft:"/>
        <replacefilter token="wd:" value="fd:"/>
        <replacefilter token="xmlns:wi" value="xmlns:fi"/>
        <replacefilter token="xmlns:wb" value="xmlns:fb"/>
        <replacefilter token="xmlns:wt" value="xmlns:ft"/>
        <replacefilter token="xmlns:wd" value="xmlns:fd"/>
      </replace>
  
      <replace dir="${target.dir}">
        <include name="**/*.xsl"/>
        <include name="**/*.xslt"/>
        <replacetoken><![CDATA[exclude-result-prefixes="wi"]]></replacetoken>
        <replacevalue><![CDATA[exclude-result-prefixes="fi"]]></replacevalue>
      </replace>
  
      <!-- references to stylesheets in sitemap and stylesheets -->
      <replace dir="${target.dir}">
        <include name="**/*.xmap"/>
        <include name="**/*.xsl"/>
        <include name="**/*.xslt"/>
        <replacefilter token="woody-advanced-field-styling.xsl"
                       value="forms-advanced-field-styling.xsl"/>
        <replacefilter token="woody-calendar-styling.xsl"
                       value="forms-calendar-styling.xsl"/>
        <replacefilter token="woody-field-styling.xsl"
                       value="forms-field-styling.xsl"/>
        <replacefilter token="woody-htmlarea-styling.xsl"
                       value="forms-htmlarea-styling.xsl"/>
        <replacefilter token="woody-page-styling.xsl"
                       value="forms-page-styling.xsl"/>
        <replacefilter token="woody-samples-styling.xsl"
                       value="forms-samples-styling.xsl"/>
      </replace>
  
      <!-- updating sitemaps -->
      <replace dir="${target.dir}">
        <include name="**/*.xmap"/>
        <!--+
            | - flow function
            +-->
        <replacetoken><![CDATA[function="woody"]]></replacetoken>
        <replacevalue><![CDATA[function="handleForm"]]></replacevalue>
      </replace>
      <replace dir="${target.dir}">
        <include name="**/*.xmap"/>
        <!--+
            | - Woody(Generator|TemplateTransformer|Messages)
            | -> Forms(Generator|TemplateTransformer|Messages)
            +-->
        <replacefilter token="Woody" value="Forms"/>
        <!--+
            | - hints for actions (removing woody "prefix")
            +-->
        <replacefilter token="woody-" value=""/>
        <!--+
            | - package name: o.a.c.woody.* -> o.a.c.forms.*
            | - hints for FormsTemplateTransformer and FormsGenerator
            | - logger
            | - i18n catalogue
            +-->
        <replacefilter token="woody" value="forms"/>
      </replace>
  
      <!-- updating flowscripts -->
      <replace dir="${target.dir}">
        <include name="**/*.js"/>
        <include name="**/*.flow"/>
        <include name="**/*.xml"/>
        <!-- Java packages -->
        <replacefilter
          token="resource://org/apache/cocoon/woody/flow/javascript/woody2.js"
          value="resource://org/apache/cocoon/forms/flow/javascript/Form.js"/>
        <replacefilter
          token="org.apache.cocoon.woody.datatype.ValidationError"
          value="org.apache.cocoon.forms.validation.ValidationError"/>
        <replacefilter
          token="org/apache/cocoon/woody"
          value="org/apache/cocoon/forms"/>
        <replacefilter
          token="org.apache.cocoon.woody"
          value="org.apache.cocoon.forms"/>
      </replace>
  
  <echo>
  -----------------------------------------------------------------------------
  Please read carefully!
  In the next step you can update the repeater binding syntax in your binding
  files. This can only be done by an XSLT and this transformation can neither
  preserve possibly available DocType declarations nor every layout detail
  (e.g. attribute order).
  You will be asked for a directory for the binding files.
  -----------------------------------------------------------------------------
  </echo>
  
      <input message="Do you want to update the repeater binding syntax in your binding files automatically? (yes|no)"
             addproperty="updateRepeaterSyntaxInput"
             defaultvalue="no"/>
  
      <condition property="updateRepeaterSyntax">
        <or>
          <equals arg1="yes" arg2="${updateRepeaterSyntaxInput}" casesensitive="false" trim="true"/>
          <equals arg1="y" arg2="${updateRepeaterSyntaxInput}" casesensitive="false" trim="true"/>
        </or>
      </condition>
  
      <antcall target="Woody2CocoonForms-repeater-syntax"/>
  
  <echo>
  -----------------------------------------------------------------------------
  The update was successful so far. You can now choose whether you want to copy
  the updated files from the target directory back to the source directory.
  
  Before copying you can have a look into the files in the target directory. You
  are also asked for a backup directory if you choose to copy.
  -----------------------------------------------------------------------------
  </echo>
  
      <input message="Do you want to copy the files from the target dir back to the src dir? (yes|no)"
             addproperty="copyFilesInput"
             defaultvalue="no"/>
  
      <condition property="copyFiles">
        <or>
          <equals arg1="yes" arg2="${copyFilesInput}" casesensitive="false" trim="true"/>
          <equals arg1="y" arg2="${copyFilesInput}" casesensitive="false" trim="true"/>
        </or>
      </condition>
  
      <antcall target="Woody2CocoonForms-copy-files"/>
  
  <echo>
  -----------------------------------------------------------------------------
  The update is now complete. Have much fun with the new Cocoon Forms.
  
                                                    The Apache Cocoon Team
  -----------------------------------------------------------------------------
  </echo>
  
    </target>
  
    <target name="Woody2CocoonForms-repeater-syntax" if="updateRepeaterSyntax">
  
      <input message="Please enter the binding dir *relative* to the above entered source dir ${target.dir}:"
             addproperty="binding.dir"
             defaultvalue="."/>
  
      <xslt basedir="${target.dir}/${binding.dir}" destdir="${temp.dir}"
            includes="**/*.xml" extension=".xml"
            style="tools/src/cforms-repeater-syntax.xsl"/>
      <move todir="${target.dir}/${binding.dir}">
        <fileset dir="${temp.dir}"/>
      </move>
    </target>
  
    <target name="Woody2CocoonForms-copy-files" if="copyFiles"
            depends="Woody2CocoonForms-do-not-copy-files">
      <input message="Please enter the backup dir (default is ${target.dir}_orig):"
             addproperty="backup.dir"
             defaultvalue="${target.dir}_orig"/>
  
      <copy todir="${backup.dir}">
        <fileset dir="${src.dir}"/>
      </copy>
  <!--
      <copy todir="${src.dir}">
        <fileset dir="${target.dir}"/>
      </copy>
  -->
    </target>
  
    <target name="Woody2CocoonForms-do-not-copy-files" unless="copyFiles">
  <echo>
  You chosed not to copy the updated files. Either do this by hand or restart
  this update process. The updated files can be found at:
  ${target.dir}
  </echo>
    </target>
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/validate-build.xml
  
  Index: validate-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="validation">
  
    <description>
      Validation targets
    </description>
  
    <!-- Check if all the JAR files are properly declared in lib/jars.xml    -->
    <target name="validate-jars" depends="prepare" unless="internal.exclude.validate.jars">
      <path id="all.jars">
        <fileset dir="${lib}">
          <include name="**/*.jar"/>
        </fileset>
        <fileset dir="${blocks}">
          <include name="*/lib/*.jar"/>
        </fileset>
      </path>
  
      <property name="all.jars" refid="all.jars"/>
      <copy file="${tools.src}/jars.xml.tmpl" 
            tofile="${build.temp}/current-jars.xml" 
            filtering="yes" overwrite="yes">
        <filterset>
          <filter token="JARS" value="${all.jars}"/>
        </filterset>
      </copy>
  
      <!-- split the path in 'jar' XML elements -->
      <replace file="${build.temp}/current-jars.xml"
               token="${path.separator}" 
               value="&lt;/jar&gt;&#xA; &lt;jar&gt;"/>
  
      <!-- relativize file names by removing the current directory -->
      <replace file="${build.temp}/current-jars.xml" 
               token="${user}${file.separator}lib${file.separator}" 
               value=""/>
      <replace file="${build.temp}/current-jars.xml" 
               token="${user}${file.separator}${blocks}${file.separator}" 
               value=""/>
  
      <!-- and incase that fails, remove the base directory -->
      <replace file="${build.temp}/current-jars.xml" 
               token="${basedir}${file.separator}lib${file.separator}" 
               value=""/>
      <replace file="${build.temp}/current-jars.xml" 
               token="${basedir}${file.separator}${blocks}${file.separator}" 
               value=""/>
  
      <!-- replace platform-dependent path separator by '/' -->
      <replace file="${build.temp}/current-jars.xml" 
               token="${file.separator}" 
               value="/"/>
  
      <xslt in="${lib}/jars.xml" out="${build.temp}/jars.xml"
            processor="trax"
            style="${tools}/src/check-jars.xsl">
        <param name="stylesheet-path" expression="${tools}/src"/>
        <param name="current-jars-path" expression="${build.temp}"/>
        <param name="current-jars-file" expression="current-jars.xml"/>
      </xslt>
    </target>
  
    <!-- Validate configuration files.
      This needs to be done at the end of the build, because the cocoon.xconf
      and cocoon.roles are automatically constructed.
    -->
    <target name="validate-config" depends="prepare" unless="internal.exclude.validate.config">
      <echo message="Validating some important configuration files"/>
  
      <echo message="Validating cocoon.xconf using a very basic RELAX NG grammar ..."/>
      <jing rngfile="${webapp}/WEB-INF/entities/any.rng">
        <fileset dir="${build.webapp}/WEB-INF" includes="cocoon.xconf"/>
      </jing>
    </target>
  
    <!-- Validation of xdocs  -->
    <target name="validate-xdocs" depends="prepare-docs" unless="internal.exclude.validate.xdocs">
  <!--
      <echo message="Conducting validation of core XML documentation."/>
  -->
      <echo message="Not conducting validation of core XML documentation."/>
      <echo message="Use 'forrest validate-xdocs' instead."/>
  
  <!-- FIXME: 
      <echo message="Validating all **/book.xml instances using RELAX NG ..."/>
      <jing rngfile="${webapp}/WEB-INF/entities/book-v01.rng">
        <fileset dir="${build.context}" includes="**/book.xml"/>
      </jing>
  -->
  
  <!--
      <echo message="Validating all xdocs/**/*.xml instances using DTDs ..."/>
      <xmlvalidate failonerror="true" lenient="no" warn="yes">
  -->
        <!-- FIXME: we can use xmlcatalog/catalogpath with Ant-1.6 -->
  <!--
        <xmlcatalog>
          <catalogpath>
            <pathelement location="${webapp}/WEB-INF/entities/catalog.xcat"/>
          </catalogpath>
        </xmlcatalog>
  -->
  <!--
        <fileset dir="${build.context}/xdocs" includes="**/*.xml"
                 excludes="status.xml,drafts/*.xml,dictionary.xml,catalog-test.xml,ctwig/sample/**/*.xml,tabs.xml,dtd/**"/>
      </xmlvalidate>
  -->
  
    </target>
  
    <target name="validate-sitemaps" depends="init-tasks"
            description="Standalone target to validate all sitemaps">
      <echo message="Validating all sitemap.xmap using RELAX NG ..."/>
      <echo>Note: This is experimental.
  You may need to tweak the sitemap-v*.rng to handle stuff that is truly valid.
  Blocks sitemaps are deliberately excluded.
      </echo>
      <jing rngfile="${webapp}/WEB-INF/entities/sitemap-v06.rng">
  <!--
        <fileset dir="${blocks}" includes="**/sitemap.xmap"/>
  -->
        <fileset dir="${webapp}" includes="**/sitemap.xmap"/>
        <fileset dir="${documentation}" includes="sitemap*.xmap"/>
        <fileset dir="${docs}" includes="**/drafts/sitemap-allowed.xmap"/>
  <!--
        <fileset dir="${docs}" includes="**/drafts/sitemap-working-draft.xmap"/>
  -->
      </jing>
    </target>
  
    <target name="validate-stylesheets" depends="init-tasks"
            description="Standalone target to validate all stylesheets">
      <echo message="Validating all XSLT stylesheets using RELAX NG ..."/>
      <jing rngfile="${webapp}/WEB-INF/entities/xslt-20020523.rng">
        <fileset dir="${src}" includes="**/*.xsl*"
          excludes="webapp/samples/catalog/*.xsl"/>
      </jing>
    </target>
  </project>
  
  
  
  1.1                  cocoon-2.1/tools/new-targets/webapp-build.xml
  
  Index: webapp-build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <project name="webapp">
  
    <description>
      Webapp targets
    </description>
  
    <target name="prepare-webapp" depends="blocks, package">
      <mkdir dir="${build.webapp}"/>
  
      <copy file="${webapp}/welcome.xml" tofile="${build.webapp}/welcome.xml" filtering="on"/>
      <copy file="${webapp}/not-found.xml" tofile="${build.webapp}/not-found.xml" filtering="on"/>
      <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on"/>
      <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap"/>
  
  	<!-- generate sitemap entries 
      <sitemap-components sitemap="${build.webapp}/sitemap.xmap" source="${java}"/>
      -->
      
      <copy todir="${build.webapp}/stylesheets" filtering="on">
        <fileset dir="${webapp}/stylesheets">
          <include name="**/*.xslt"/>
        </fileset>
      </copy>
  
      <copy todir="${build.webapp}/resources" filtering="off">
        <fileset dir="${webapp}/resources"/>
      </copy>
  
      <copy todir="${build.webapp}/WEB-INF" filtering="on">
        <fileset dir="${webapp}/WEB-INF">
          <include name="entities/**"/>
          <include name="classes/**"/>
          <include name="*.x*"/>
        </fileset>
      </copy>
  
      <copy file="${build}/${name}.jar" tofile="${build.webapp.lib}/${name}-${version}.jar"/>
  
      <copy todir="${build.webapp.lib}">
        <fileset dir="${lib}/endorsed">
          <include name="*.jar"/>
          <exclude name="servlet*.jar"/>
        </fileset>
        <fileset dir="${lib.core}">
          <include name="*.jar"/>
          <exclude name="servlet*.jar"/>
        </fileset>
        <!-- Currently, we have no JVM dependent libraries
          <fileset dir="${lib.core}/jvm${target.vm}">
            <include name="*.jar"/>
          </fileset>
        -->
        <fileset dir="${lib.optional}">
          <include name="*.jar"/>
          <exclude name="servlet*.jar"/>
        </fileset>
        <fileset dir="${lib.local}">
          <include name="*.jar"/>
          <exclude name="servlet*.jar"/>
        </fileset>
      </copy>
  
      <copy todir="${build.webapp.lib}">
        <fileset dir="${build.blocks}">
          <include name="*-block.jar"/>
        </fileset>
        <mapper type="glob" from="*-block.jar" to="cocoon-*-block.jar"/>
      </copy>
  
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="lib"/>
  
      <ant antfile="${build.temp}/blocks-build.xml"
           inheritAll="true"
           inheritRefs="false"
           target="patch"/>
    </target>
  
    <target name="prepare-webapp-samples" depends="prepare-webapp, samples, block-samples" unless="internal.exclude.webapp.samples"/>
  
    <target name="prepare-webapp-test-suite" depends="prepare-webapp" unless="internal.exclude.webapp.test-suite">
      <!-- copy test suite files -->
      <copy todir="${build.webapp.test-suite}">
        <fileset dir="${webapp.test-suite}"/>
      </copy>
    </target>
  
    <target name="prepare-webapp-deprecated" depends="prepare-webapp" unless="internal.exclude.deprecated">
      <copy file="${build}/${name}-deprecated.jar" tofile="${build.webapp.lib}/${name}-${version}-deprecated.jar"/>
  <!--
      <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf"
              srcdir="${deprecated.conf}"
              includes="**/*.xconf"
              addComments="true"/>
  -->
    </target>
  
    <target name="prepare-webapp-javadocs" depends="javadocs" unless="internal.exclude.webapp.javadocs">
      <mkdir dir="${build.webapp.javadocs}"/>
  
      <copy todir="${build.webapp.javadocs}" filtering="off">
        <fileset dir="${build.javadocs}"/>
      </copy>
  
      <!-- patch the welcome page to tell we have javadocs to show -->
      <xpatch file="${build.webapp}/welcome.xml"
              srcdir="${resources.javadoc}"
              includes="**/*.xwelcome"/>
    </target>
  
    <target name="prepare-webapp-docs" depends="validate-xdocs,validate-jars" unless="internal.exclude.webapp.documentation">
      <mkdir dir="${build.webapp.docs}"/>
  
      <copy todir="${build.webapp.docs}" filtering="on">
        <fileset dir="${documentation}">
          <exclude name="**/*.jpg"/>
          <exclude name="**/*.gif"/>
          <exclude name="**/*.png"/>
        	<exclude name="*.xwelcome"/>
        </fileset>
      </copy>
  
      <!-- Add some other documents -->
      <copy file="status.xml"
        tofile="${build.webapp.docs}/xdocs/status.xml" filtering="on"/>
      <!-- Copy the docs about all jar files (this requires a dependency to validate-jars) -->
      <copy file="${build.temp}/jars.xml"
        tofile="${build.webapp.docs}/xdocs/installing/jars.xml"
        filtering="off" failonerror="false" overwrite="true"/>
  
      <!-- Forrest needs its own file at src/documentation/sitemap.xmap, so we
      overwrite it with the old Cocoon-specific sitemap here -->
      <copy file="${documentation}/sitemap-localdocs.xmap"
        tofile="${build.webapp.docs}/sitemap.xmap" overwrite="true"/>
  
      <copy todir="${build.webapp.docs}" filtering="off">
        <fileset dir="${documentation}">
          <include name="**/*.jpg"/>
          <include name="**/*.gif"/>
          <include name="**/*.png"/>
        </fileset>
      </copy>
  
      <!-- patch the welcome page to tell we have documentation to show -->
      <xpatch file="${build.webapp}/welcome.xml"
              srcdir="${documentation}"
              includes="**/*.xwelcome"/>
    </target>
  
    <target name="webapp" depends="prepare-webapp,prepare-webapp-samples,prepare-webapp-docs,prepare-webapp-javadocs,prepare-webapp-test-suite,prepare-webapp-deprecated,validate-jars,validate-config,custom-conf" description="Builds web application folder">
    </target>
  
    <target name="war" depends="webapp" description="Builds web application archive">
      <!-- A task to create manifest for webapp. -->
      <taskdef name="manifest" classname="ManifestToolTask" classpath="${tools.tasks.dest}"/>
      <!-- Create WAR manifest -->
      <manifest directory="${build.webapp.lib}" manifest="${build.webapp}/WEB-INF/Manifest.mf"/>
      <!-- Package WAR file -->
      <jar jarfile="${build.war}"  manifest="${build.webapp}/WEB-INF/Manifest.mf" index="true">
        <fileset dir="${build.webapp}"/>
      </jar>
    </target>
  
    <target name="custom-conf" depends="init-tasks" description="Uses Cocoon's xpatch task to customize runtime configuration">
      <xpatch file="${build.webapp}/sitemap.xmap" srcdir="">
         <include name="${customconf}/*.xmap" />
         <include name="${customconf}/*.xpipe" />
      </xpatch>
      <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf" srcdir="" addComments="true">
         <include name="${customconf}/*.xconf" />
      </xpatch>
      <xpatch file="${build.webapp}/WEB-INF/logkit.xconf" srcdir="">
         <include name="${customconf}/*.xlog" />
      </xpatch>
      <xpatch file="${build.webapp}/WEB-INF/web.xml" srcdir="">
         <include name="${customconf}/*.xweb" />
      </xpatch>
    </target>
  </project>
  
  
  

Mime
View raw message