forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Cocoon Ant Task
Date Mon, 13 Oct 2003 12:27:06 GMT
I've just committed a Cocoon Ant task to Cocoon CVS, and would welcome 
feedback on it.

Notable points include:
1) The xconf is included within the build file, not referenced as a file
2) This task shares the same xconf parsing code with the CLI 
(Main.java), which means that extensions to the bean only need be added 
in one place.
3) There are no <node>value</node> entries, as Ant doesn't do variable 
substitution on them
4) It runs Cocoon in the same process as Ant - it doesn't fork or 
anything. If any such functionality is required, it can be added.

Please give it a go and let me know what you make of it, and whether it 
works.

Below is a sample build file that uses it.

Regards, Upayavira

<?xml version="1.0"?>
<project default="cocoon" basedir="." name="Apache Cocoon">

    <property name="cocoon.context" value="<PATH TO YOUR COCOON WEBAPP>"/>

    <path id="cp">
      <fileset dir="${cocoon.context}/WEB-INF/lib" includes="*.jar"/>
    </path>
 
    <taskdef name="cocoon" classname="org.apache.cocoon.CocoonTask" 
classpathref="cp"/>
   
    <target name="cocoon">

        <cocoon verbose="true" 
                classpathref="cp"
                follow-links="true"
                precompile-only="false"
                confirm-extensions="false"
                md5-compare="true"
                context-dir="${cocoon.context}"
                config-file="WEB-INF/cocoon.xconf"
                work-dir="build/work"
                dest-dir="build/dest"
                checksums-uri="build/work/checksums"
                default-filename="index.html"
                accept="*/*">
       
           <broken-links type="xml"
                         file="brokenlinks.xml"
                         generate="false"
                         extension=".error"/>
          
           <logging log-kit="d:/documents/cocoon/cocoon 
dev/build/webapp/WEB-INF/logkit.xconf" logger="cli" level="DEBUG" />

           <include pattern="**"/>
           <exclude pattern="docs/apidocs/**"/>
       
           <uri type="replace"
                src-prefix="samples/"
                src="hello-world/hello.html"
                dest="build/dest/hello-world.html"/>
           
           <uris name="docs" follow-links="true">
             <uri type="append"
                  src-prefix="docs/"
                  src="index.html"
                  dest="build/dest/"
                  />
           </uris>
          
           <uris name="samples"
                 follow-links="false"
                 src-prefix="samples/"
                 dest="build/dest/examples/"
                 type="append"
                 md5-compare="true"
                 >
              <uri src=""/>
              <uri src="hello-world/hello.html"/>
              <uri src="hello-world/hello.xml"/>
           </uris>
       
        </cocoon>
    </target>
</project>


Mime
View raw message