Hi,

I typically use an Ant build file like the following. It assumes sources are located in a org/ subdir, custom libs are located in lib/, and that a environment variable named COCOON points to the base of the Cocoon web application..

Cheers,
Geert

<!-- $Id$-->

<project name="cocoonext" default="jar" basedir=".">

  <description>
    Build the cocoon libraries using Ant.

    You MUST have an environment variable named COCOON, which points to
    the directory containing the cocoon 'webapp' directory, e.g.
        export COCOON="/home/user/cocoon"
    or
        set COCOON "E:software\cocoon-2.1.4\build"
    This may be set from your own build.bat or build.sh file.

    Of course, the jar file that is produced by the build process must be
    copied into the Cocoon lib-directory after the build process.
    The jar-files in the lib-directory must also be copied to the Cocoon lib.
  </description>

  <property environment="env"/>
  <property name="cocoon.lib" location="${env.COCOON}/webapp/WEB-INF/lib"/>
  <property name="src" location="org"/>
  <property name="lib" location="lib"/>
  <property name="build" location="build"/>
  <property name="jarname" location="cocoonext"/>

  <target name="init">
    <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init" description="compile all sources" >
    <javac srcdir="${src}" destdir="${build}">
      <classpath>
        <pathelement path="${classpath}"/>
        <fileset dir="${cocoon.lib}">
          <include name="**/*.jar"/>
        </fileset>
        <fileset dir="${lib}">
          <include name="*.jar"/>
        </fileset>
      </classpath>
    </javac>
  </target>

  <target name="jar" depends="compile" description="generate the jar-file" >
    <jar jarfile="${jarname}.jar" basedir="${build}"/>
  </target>

  <target name="clean" description="clean up" >
    <delete dir="${build}"/>
  </target>

</project>

Lars Huttar wrote:
Hello,
I've been wanting to use the ValidationTransformer and ValidationTransformerReporter described on the wiki at http://wiki.apache.org/cocoon/ValidationTransformer The source code is given in some java files but I'm having trouble compiling them. In particular, the code has imports for various other Cocoon components. I could add all the .jar files Cocoon uses into the CLASSPATH, but that would be pretty laborious. What is the normal mechanism for compiling such Java files? Of course I will then want toput the classes into a jar, install that in the right place, and have Cocoon find it. Can I accomplish all that by putting the files into a new block? If so, what is the procedure for creating a block?

I have searched around on cocoon.apache.org and the wiki for info on creating a block, but all I see is documentation about how a block should or could work.
Any help would be appreciated.

I contacted the author a couple of weeks ago but have not received a reply.

Lars


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




--
=====================================
NB: het Daidalos kantoor is sinds 22 april
jl. gevestigd op een nieuw adres:

Daidalos BV
Hoekeindsehof 1 - 4
2665 JZ Bleiswijk
tel: +31 (0)10 850 12 00
fax: +31 (0)10 850 11 99

Bovenstaand adres is tevens het postadres.
======================
[EMAIL PROTECTED]
IT-consultant at Daidalos BV

http://www.daidalos.nl/

GPG: 1024D/12DEBB50

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

Reply via email to