RE: How do you compile HTML to Java class with XMLC?

"Christian Cryder" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
> Is in the BUILD.XML file that you indicate which directories to hunt for
> HTML files?

Yep. I'm attaching a sample build.xml from a typical project that uses
Barracuda...you can see how we copy the mockups to a target directory, and
then XMLC compiles from that. Look for  the mockps.compile target.

CHristian
----------------------------------------------
Christian Cryder
Internet Architect, ATMReports.com
Project Chair, BarracudaMVC - http://barracudamvc.org
----------------------------------------------
"Coffee? I could quit anytime, just not today"


> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Steve Swett
> Sent: Thursday, August 14, 2003 1:13 PM
> To: [email protected]
> Subject: RE: [Barracuda] How do you compile HTML to Java class with
> XMLC?
>
>
> OK, I see that if I use "ant xmlc" while the current directory is
> "c:\Barracuda\src" that it will recompile all HTML files in the
> "C:\Barracuda\src\org\enhydra\barracuda\tutorials\xmlc" folder.
>
> The result is a class file with the org.enhydra... package name.
>
> It doesn't want to compile the html files if they are in different
> directories.  If I move my HTML to that directory, it will compile, but
> it gives the long package name.
>
> Is in the BUILD.XML file that you indicate which directories to hunt for
> HTML files?
>
> Thanks.
>
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Jacob Kjome
> Sent: Thursday, August 14, 2003 2:38 PM
> To: [email protected]
> Subject: Re: [Barracuda] How do you compile HTML to Java class with
> XMLC?
>
>
> You should really post a question like this to the XMLC list, but I'll
> answer it here anyway.  This is configurable via the command line.  If
> you
> use the XMLC taskdef or Barracuda's Localize taskdef (which extends the
> XMLC taskdef), then the behavior you want will happen automatically.
> Check
> out the Ant build files in the examples of XMLC-2.2RC1 release to see
> how
> to use the XMLC taskdef.
> http://forge.objectweb.org/projects/xmlc/
>
> I can't quite remember all the command line parameters offhand.  I've
> used
> the Ant tasks for so long that running XMLC directly on the command line
>
> seems almost foreign to me at this point.
>
> BTW, xmlc.enhydra.org hasn't been updated in a while.  It will be
> updated
> for the XMLC-2.2 release to point to the objectweb site which is the new
>
> home of the XMLC CVS code and all downloads.  Only the mailing list is
> used
> at xmlc.enhydra.org currently.
>
> Jake
>
> At 02:08 PM 8/14/2003 -0400, you wrote:
>
> >Is there anything already in the Barracuda package distribution that
> can
> >be run to compile:
> >
> >
> >
> >myTest.html
> >
> >
> >
> >to
> >
> >
> >
> >myTestHTML.class
> >
> >
> >
> >
> >
> >& or do I just download XMLC from xmlc.enhydra.org, compile the html to
>
> >myTest.class and then rename the class to myTestHTML.class?
> >
> >
> >
> >Thanks.
> >
> >
>
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda
>
>
>
>
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda
build.xml (text/xml, 45.8 KB)
<!--
/*
 * Copyright 2003 ATMReports.com. All Rights Reserved.
 *
 * This software is the proprietary information of ATMReports.com.
 * Use is subject to license terms.
 *
 * $Id: build.xml,v 1.35 2003/08/08 19:49:26 christianc Exp $
 */
-->
<project name="ATMReports" default="compile.all" basedir=".">

    <!-- Set up application info -->
    <property file="build.properties"/>
    <property name="app.name" value="ATMReports"/>
    <property name="app.package.base.path" value="com/atmr"/>
    <property name="app.package.base.name" value="com.atmr"/>
    <property name="app.short.name" value="atmreports"/>
    <property name="app.short.help.name" value="atmreports_help"/>
    <property name="app.year" value="2002"/>
    <property name="company.name" value="ATMReports.com"/>

    <!-- root info -->
    <property name="root.dir" value="../../" />
    <property name="bin.dir" value="${basedir}" />
    <property name="build.dir" value="${root.dir}/WEB-INF" />

    <!-- dependency info -->
    <property name="tomcat.root.dir" value="D:/Program Files/Apache Group/Tomcat 4.1" />
    <property name="tomcat.common.dir" value="${tomcat.root.dir}/common" />
    <property name="tomcat.common.lib.dir" value="${tomcat.common.dir}/lib" />
    <property name="tomcat.shared.dir" value="${tomcat.root.dir}/shared" />
    <property name="tomcat.shared.lib.dir" value="${tomcat.shared.dir}/lib" />
    <property name="tomcat.server.dir" value="${tomcat.root.dir}/server" />
    <property name="tomcat.server.lib.dir" value="${tomcat.server.dir}/lib" />
    <property name="kilimanjaro.root.dir" value="${root.dir}/../../Arch/Kilimanjaro" />
    <property name="kilimanjaro.build.dir" value="${kilimanjaro.root.dir}/WEB-INF" />
    <property name="kilimanjaro.build.jar.dir" value="${kilimanjaro.build.dir}/jars" />
    <property name="kilimanjaro.build.lib.dir" value="${kilimanjaro.build.dir}/lib" />
    <property name="kilimanjaro.build.javadocs.dir" value="${kilimanjaro.root.dir}/javadocs" />

    <!-- deploy info -->
    <property name="deploy.root.dir" value="${root.dir}/../${app.name}Deploy"/>
    <property name="deploy.build.dir" value="${deploy.root.dir}/WEB-INF"/>
    <property name="deploy.build.lib-cvs.dir" value="${deploy.build.dir}/lib-cvs"/>

    <!-- source files -->
    <property name="src.dir" value="${build.dir}/src" />
    <property name="src.tests.dir" value="${build.dir}/src_tests" />
    <property name="src.mockups.dir" value="${build.dir}/src_mockups" />
    <property name="src.mockups.help.dir" value="${src.mockups.dir}/${app.short.help.name}" />
    <property name="src.package.path" value="${app.package.base.path}/${app.short.name}" />
    <property name="src.package.name" value="${app.package.base.name}.${app.short.name}" />
    <property name="src.taskdefs.path" value="${src.package.path}/taskdefs" />
    <property name="src.scripts.path" value="${src.package.path}/scripts" />

    <!-- build info -->
    <property name="build.temp.dir" value="${build.dir}/xtmp$" />
    <property name="build.source.event.dir" value="${build.temp.dir}/src_events/"/>
    <property name="build.source.xmlc.dir" value="${build.temp.dir}/src_xmlc/"/>
    <property name="build.taskdefs.dir" value="${build.dir}/jars" />
    <property name="build.classes.dir" value="${build.dir}/classes" />
    <property name="build.xlib.dir" value="${build.classes.dir}/xlib" />
    <property name="build.jar.dir" value="${build.dir}/jars" />
    <property name="build.lib.dir" value="${build.dir}/lib" />
    <property name="build.lib-cvs.dir" value="${build.dir}/lib-cvs" />
    <property name="build.help.dir" value="${root.dir}/help" />
    <property name="build.javadocs.dir" value="${root.dir}/javadocs" />
    <property name="build.test.classes.dir" value="${build.dir}/classes_test" />

    <!-- content files -->
    <property name="content.dir" value="${root.dir}" />
    <property name="dtds.dir" value="${root.dir}/dtds" />

    <!-- unit test setup -->
    <property name="unit.test.dir" value="${build.dir}/unit_tests" />
    <property name="unit.test.reports.dir" value="${root.dir}/unit_tests" />
    <property name="junit.haltonfailure" value="no"/>

    <!-- javadocs -->
    <property name="javadoc.packages" value="com.atmr.atmreports.*"/>

    <!-- database info -->
    <property name="db.root.dir" value="${build.dir}/db"/>
    <property name="db.archive.dir" value="${db.root.dir}/archives"/>
    <property name="db.script.dir" value="${db.root.dir}/scripts"/>
    <property name="db.driver" value="com.jnetdirect.jsql.JSQLDriver"/>
    <property name="db.url" value="jdbc:JSQLConnect://localhost"/>
    <property name="db.name" value="${app.name}Dev"/>
    <property name="db.username" value="sa"/>
    <property name="db.password" value=""/>

    <!-- webapp info -->
    <property name="webapp.path" value="/${app.name}Dev"/>
    <property name="webapp.username" value="kjadmin"/>
    <property name="webapp.password" value="p!t*n"/>

    <!-- classpaths -->
    <path id="build.classpath">
        <!-- development libraries -->
        <fileset dir="${build.lib.dir}" >
            <include name="*.jar" />
            <exclude name="${app.short.name}.jar" />
        </fileset>

        <!-- other development libraries -->
        <fileset dir="${build.jar.dir}" >
            <include name="*.jar" />
        </fileset>

        <!-- Tomcat development libraries -->
        <fileset dir="${tomcat.common.lib.dir}" >
            <include name="*.jar" />
        </fileset>
        <fileset dir="${tomcat.shared.lib.dir}" >
            <include name="*.jar" />
        </fileset>
        <fileset dir="${tomcat.server.lib.dir}" >
            <include name="catalina-ant.jar" />
        </fileset>
    </path>

    <path id="build.full.classpath">
        <pathelement location="${build.classes.dir}" />
        <pathelement location="${build.test.classes.dir}" />
        <path refid="build.classpath" />
    </path>

    <taskdef name="dialog"
             classname="com.kasisoft.ant.interactive.Interactive"
             classpath="${build.jar.dir}/interactive.jar"
    />


    <!-- ============================ Project Targets ============================ -->
    <!-- ======================================================= -->
    <!-- PHASE 0 - Upgrade Library Dependencies                  -->
    <!-- ======================================================= -->
    <!-- You should only run this when you want to upgrade the   -->
    <!-- project to the newest version of dependency libraries   -->
    <target name="update-deps" description="Update libraries on which this project depends and install">
        <copy file="${kilimanjaro.build.jar.dir}/barracuda-ant.jar" todir="${build.jar.dir}"/>
        <copy file="${kilimanjaro.build.jar.dir}/xmlc-taskdef-2.2.jar" todir="${build.jar.dir}"/>
        <copy file="${kilimanjaro.build.jar.dir}/barracuda-testbed.jar" todir="${build.jar.dir}"/>
        <copy file="${kilimanjaro.build.jar.dir}/kilimanjaro-ant.jar" todir="${build.jar.dir}"/>
        <copy file="${kilimanjaro.build.lib.dir}/barracuda.jar" todir="${build.lib-cvs.dir}"/>
        <copy file="${kilimanjaro.build.lib.dir}/log4j-sandbox-servlet-0.1alpha.jar" todir="${build.lib-cvs.dir}"/>
        <copy file="${kilimanjaro.build.lib.dir}/kilimanjaro.jar" todir="${build.lib-cvs.dir}"/>
        <antcall target="install"/>
    </target>

    <!-- Install the application. We basically need to           -->
    <!-- a) copy sample files if they don't exist                -->
    <!-- b) copy jars from lib-cvs to lib                        -->
    <target name="install" description="Install a new version of this app" >
        <!-- recursively copy & map sample.* files to * only if (not sample.*.zip) and (* doesn't exist) -->
        <copy todir="${root.dir}" >
            <fileset dir="${root.dir}" includes="**/sample.*" excludes="**/sample.*.zip">
                <present present="srconly" targetdir="${root.dir}">
                    <mapper type="regexp" from="^(.*)sample\.(.+)$" to="\1\2"/>
                </present>
            </fileset>
            <mapper type="regexp" from="^(.*)sample\.(.+)$" to="\1\2"/>
        </copy>

        <!-- extract sample.*.zip files in WEB-INF -->
        <!-- unfortunately, this cannot be made to work recursively -->
        <unzip dest="${build.dir}">
            <fileset dir="${build.dir}" includes="sample.*.zip"/>
        </unzip>

        <!-- copy jars from lib-cvs to lib -->
        <mkdir dir="${build.lib.dir}" />
        <copy todir="${build.lib.dir}" >
            <fileset dir="${build.lib-cvs.dir}" includes="*.jar" />
        </copy>
    </target>

    <!-- Rebuild the database. We basically need to              -->
    <!-- a) stop the webapp (if running)                         -->
    <!-- b) kill all open db connections                         -->
    <!-- c) drop and recreate the database                       -->
    <!-- d) rebuild the database from the erwin script           -->
    <!-- e) insert sample data from archives                     -->
    <!-- f) start the webapp (if it was running)                 -->
    <target name="db.rebuild" description="Rebuild the database">
        <!-- stop webapp -->
        <antcall target="webapp.stop"/>

        <!-- load the 'disconnect_users' stored procedure (it can't be executed directly from jdbc) -->
        <sql driver="${db.driver}"
             url="${db.url}/database=master"
             userid="${db.username}"
             password="${db.password}"
             classpathref="build.classpath"
             onerror="continue"
             src="${db.script.dir}/disconnect_users.sql"
        />

        <!-- disconnect users and recreate empty database -->
        <sql driver="${db.driver}"
             url="${db.url}/database=master"
             userid="${db.username}"
             password="${db.password}"
             classpathref="build.classpath"
             onerror="abort"
             autocommit="true">

            <transaction>execute disconnect_users '${db.name}'</transaction>
            <transaction>drop database ${db.name}</transaction>
            <transaction>create database ${db.name}</transaction>
        </sql>

        <!-- build the database -->
        <sql driver="${db.driver}"
             url="${db.url}/database=${db.name}"
             userid="${db.username}"
             password="${db.password}"
             classpathref="build.classpath"
             onerror="abort"
             autocommit="true"
             delimiter="go"
             src="${db.root.dir}/${app.name}.sql"
        />

        <!-- load sample data -->
        <sql driver="${db.driver}"
             url="${db.url}/database=${db.name}"
             userid="${db.username}"
             password="${db.password}"
             classpathref="build.classpath"
             onerror="abort"
             autocommit="false">

            <fileset dir="${db.archive.dir}" includes="*.sql" />
        </sql>

        <!-- start webapp -->
        <antcall target="webapp.start"/>
    </target>

    <target name="webapp.stop" description="Try to stop the webapp; this task always succeeds">
        <taskdef name="nofail" classname="com.atmr.kilimanjaro.taskdefs.NoFail" classpathref="build.classpath"/>
        <taskdef name="webstop" classname="org.apache.catalina.ant.StopTask" classpathref="build.classpath" />
        <nofail><webstop path="${webapp.path}" username="${webapp.username}" password="${webapp.password}"/></nofail>
    </target>

    <target name="webapp.start" description="Try to start the webapp; this task always succeeds">
        <taskdef name="nofail" classname="com.atmr.kilimanjaro.taskdefs.NoFail" classpathref="build.classpath"/>
        <taskdef name="webstart" classname="org.apache.catalina.ant.StartTask" classpathref="build.classpath" />
        <nofail><webstart path="${webapp.path}" username="${webapp.username}" password="${webapp.password}"/></nofail>
    </target>

    <target name="webapp.reload" description="Try to reload the webapp; this task always succeeds">
        <taskdef name="nofail" classname="com.atmr.kilimanjaro.taskdefs.NoFail" classpathref="build.classpath"/>
        <taskdef name="webreload" classname="org.apache.catalina.ant.ReloadTask" classpathref="build.classpath" />
        <nofail><webreload path="${webapp.path}" username="${webapp.username}" password="${webapp.password}"/></nofail>
    </target>

    <!-- ======================================================= -->
    <!-- PHASE 1 - Cleanup & Initialization                      -->
    <!-- ======================================================= -->
    <!-- clean up everything -->
    <target name="clean" depends="taskdefs.clean, mockups.clean, compile.clean, test.clean"
            description="Clean up everything" >
        <delete dir="${build.classes.dir}" quiet="true" />
        <delete dir="${build.lib.dir}" quiet="true" />
        <property name="xmlc.force" value="true" />
    </target>

    <!-- init everything -->
    <target name="init" depends="install" description="Prepare everything for build" >
        <tstamp/>
    </target>



    <!-- ======================================================= -->
    <!-- PHASE 2 - Build Custom Taskdefs                         -->
    <!-- ======================================================= -->
    <!-- clean up custom taskdef area -->
    <target name="taskdefs.clean" description="Clean up all custom taskdef areas" >
        <delete dir="${build.classes.dir}/${src.taskdefs.path}" quiet="true" />
        <delete dir="${build.test.classes.dir}/${src.taskdefs.path}" quiet="true" />
        <delete file="${build.jar.dir}/${app.short.name}-ant.jar" quiet="true" />
    </target>

    <!-- init custom taskdef area -->
    <target name="taskdefs.init" description="Prepare everything for build" >
        <mkdir dir="${build.dir}" />
        <mkdir dir="${build.classes.dir}" />
        <mkdir dir="${build.lib.dir}" />
    </target>

    <!-- compile custom taskdef code -->
    <target name="taskdefs.compile" depends="init,taskdefs.init" description="Compile custom taskdef code" >
        <!-- copy the taskdef source -->
        <javac srcdir="${src.dir}"
            destdir="${build.classes.dir}"
            includes="${src.taskdefs.path}/*.java"
            excludes="**/old*/**"
            classpathref="build.classpath"
            includeJavaRuntime="no"
        />
        <!-- copy dtds into the xlib resources directory -->
        <copy todir="${build.xlib.dir}/dtds" >
          <fileset dir="${dtds.dir}" />
        </copy>
    </target>

    <!-- compile taskdef unit tests -->
    <target name="taskdefs.test.compile" depends="init,test.setup" description="Compile taskdef unit tests" >
        <javac srcdir="${src.tests.dir}"
            destdir="${build.test.classes.dir}"
            includes="${src.taskdefs.path}/*.java"
            excludes="**/old*/**"
            classpathref="build.classpath"
        />
    </target>

    <!-- fileset for all taskdef test files -->
    <fileset dir="${src.tests.dir}" id="test.taskdef.files">
      <include name="${src.taskdefs.path}/Test*.java" />
      <exclude name="**/TestUtil.java" />
    </fileset>

    <!-- run all taskdef unit tests in batch mode -->
    <target name="taskdefs.test.all" depends="taskdefs.compile,taskdefs.test.compile" description="Run all taskdef unit tests in batch mode" >
        <antcall target="test.batch">
            <param name="batchtest" value="test.taskdef.files"/>
        </antcall>
    </target>

    <!-- create custom taskdef jar file -->
    <target name="taskdefs" depends="taskdefs.compile" description="Create custom taskdef jar file" >
        <jar jarfile="${build.jar.dir}/${app.short.name}-ant.jar"
             basedir="${build.classes.dir}"
             includes="${src.taskdefs.path}/**"
        />
    </target>

    <!-- verify the custom taskdef is actually available -->
    <target name="taskdefs.verify" description="Verify the custom taskdef works" >
        <taskdef name="echo2" classname="${src.package.name}.taskdefs.SampleTaskdef" classpathref="build.classpath"/>
        <echo2 message="Verified SampleTaskdef works!"/>
    </target>



    <!-- ======================================================= -->
    <!-- PHASE 3 - Prepare Mockups                               -->
    <!-- ======================================================= -->
    <!-- clean up mockup related areas -->
    <target name="mockups.clean" description="Clean up mockup related areas" >

        <!-- /atmreports mockups dir -->
        <antcall target="mockups.clean.www" />

        <!-- /atmreports_help mockups dir -->
        <antcall target="mockups.clean.help" />

        <!-- xmlc source dir -->
        <delete quiet="true" >
            <fileset dir="${src.dir}/${src.package.path}/xmlc"
                     includes="**/*.html"
            />
        </delete>
    </target>
    <target name="mockups.clean.www" description="Clean up www mockups" >
        <echo message="path: ${src.mockups.dir}" />
        <delete quiet="true" >
            <fileset dir="${src.mockups.dir}"
                     includes="**/*.ssi"
                     excludes="**/page_start*.ssi,
                               **/page_end*.ssi,
                               **/report_start.ssi,
                               **/report_end.ssi"
            />
        </delete>
    </target>
    <target name="mockups.clean.help" description="Clean up help mockups" >
        <echo message="path: ${src.mockups.help.dir}" />
        <delete quiet="true" >
            <fileset dir="${src.mockups.help.dir}"
                     includes="**/*.ssi"
                     excludes="**/page_start*.ssi,
                               **/page_end*.ssi,
                               **/report_start.ssi,
                               **/report_end.ssi"
            />
        </delete>
    </target>


    <!-- init mockup areas -->
    <target name="mockups.init" description="Prepare everything for build" >
        <mkdir dir="${build.dir}" />
        <mkdir dir="${build.classes.dir}" />
    </target>

    <!-- generate ssi files from mockup html -->
    <target name="mockups.ssi" depends="taskdefs, mockups.init" description="Generate mockup ssi files" >
        <taskdef name="generate_ssi" classname="org.enhydra.barracuda.taskdefs.GenerateSSIs" classpathref="build.classpath" />

        <!-- /atmreports mockups -->
        <antcall target="mockups.ssi.www" />

        <!-- /atmreports_help mockups -->
        <antcall target="mockups.ssi.help" />
    </target>
    <target name="mockups.ssi.www" depends="taskdefs, mockups.init" description="Generate mockup www ssi files" >
        <taskdef name="generate_ssi" classname="org.enhydra.barracuda.taskdefs.GenerateSSIs" classpathref="build.classpath" />
        <generate_ssi touchPattern="**/*.shtml" force="false" verbose="false">
            <fileset dir="${src.mockups.dir}"
                     includes="**/A_*.html"
                     excludes="**/old*/**" />
        </generate_ssi>
    </target>
    <target name="mockups.ssi.help" depends="taskdefs, mockups.init" description="Generate mockup help ssi files" >
        <taskdef name="generate_ssi" classname="org.enhydra.barracuda.taskdefs.GenerateSSIs" classpathref="build.classpath" />
        <generate_ssi touchPattern="**/*.shtml" force="false" verbose="false">
            <fileset dir="${src.mockups.help.dir}"
                     includes="**/A_*.html"
                     excludes="**/old*/**" />
        </generate_ssi>
    </target>


    <!-- deploy mockups -->
    <target name="mockups.deploy" depends="mockups.ssi" description="Deploy the mockups to dev directories and munge contents as needed" >
        <taskdef name="copyrepl" classname="org.enhydra.barracuda.taskdefs.CopyAndReplace" classpathref="build.classpath" />
        <!-- /atmreports mockups -->
        <antcall target="mockups.deploy.www" />

        <!-- /atmreports_help mockups -->
        <antcall target="mockups.deploy.help" />
    </target>
    <target name="mockups.deploy.www" depends="mockups.ssi.www" description="Deploy the mockups to dev directories and munge contents as needed" >
        <taskdef name="copyrepl" classname="org.enhydra.barracuda.taskdefs.CopyAndReplace" classpathref="build.classpath" />
        <!-- copy templates to the xmlc directory -->
        <copyrepl todir="${src.dir}/${src.package.path}/xmlc" mappings="${src.mockups.dir}/${app.short.name}/options.mappings" ssi="true">
            <fileset dir="${src.mockups.dir}/${app.short.name}" includes="**/*.shtml" excludes="**/old*/**,**/X_*.shtml" />
            <mapper type="glob" from="*.shtml" to="*.html"/>
        </copyrepl>
        <!-- copy static resources to the xlib dir (with mappings) -->
        <copyrepl todir="${build.xlib.dir}/${src.package.path}" mappings="${src.mockups.dir}/${app.short.name}/options.mappings" >
            <fileset dir="${src.mockups.dir}/${app.short.name}" includes="scripts/**" excludes="**/old*/**,**/*.cpt" />
        </copyrepl>
        <!-- copy static resources to the xlib dir (with mappings) -->
        <copyrepl todir="${build.xlib.dir}/${src.package.path}" mappings="${src.mockups.dir}/${app.short.name}/options.css.mappings" >
            <fileset dir="${src.mockups.dir}/${app.short.name}" includes="images/**,styles/**" excludes="**/old*/**,**/*.cpt" />
        </copyrepl>
    </target>
    <target name="mockups.deploy.help" depends="mockups.ssi.help" description="Deploy the mockups to dev directories and munge contents as needed" >
        <taskdef name="copyrepl" classname="org.enhydra.barracuda.taskdefs.CopyAndReplace" classpathref="build.classpath" />
        <!-- copy toc to the xmlc directory -->
        <copyrepl todir="${src.dir}/${src.package.path}/xmlc" mappings="${src.mockups.dir}/${app.short.help.name}/options.mappings" ssi="true">
            <fileset dir="${src.mockups.help.dir}" includes="TableOfContents.shtml" />
            <mapper type="glob" from="*.shtml" to="*.html"/>
        </copyrepl>
        <!-- copy static resources to the xlib directory -->
        <copyrepl todir="${build.xlib.dir}/${app.short.help.name}" mappings="${src.mockups.dir}/${app.short.help.name}/options.mappings" ssi="true" >
            <fileset dir="${src.mockups.dir}/${app.short.help.name}" includes="**/*.shtml" excludes="**/old*/**,TableOfContents.shtml" />
            <mapper type="glob" from="*.shtml" to="*.html"/>
        </copyrepl>
        <copyrepl todir="${build.xlib.dir}/${app.short.help.name}" mappings="${src.mockups.dir}/${app.short.help.name}/options.css.mappings" >
            <fileset dir="${src.mockups.dir}/${app.short.help.name}" includes="images/**,styles/**" excludes="**/old*/**,**/*.cpt" />
        </copyrepl>
    </target>


    <!-- localize mockups as required -->
    <target name="mockups.compile" depends="mockups.deploy" unless="compile.xmlc.target.done"
            description="Run the XMLC taskdef to compile any XMLC template files into java classes" >

        <!-- /atmreports localization -->
        <taskdef name="localize" classname="org.enhydra.barracuda.taskdefs.Localize" classpathref="build.classpath" />
        <localize classpathref="build.classpath" markup="HTML" tidy="true" verbose="false" force="${xmlc.force}"
            srcdir="${src.dir}/${src.package.path}/xmlc"
            packagedir="${src.package.path}/xmlc"
            options="${xmlc_options.file}"
            sourceout="${build.source.xmlc.dir}"
            destdir="${build.classes.dir}"
            includes="**/*.html"
            excludes="**/old*/**"
        />
        <property name="compile.xmlc.target.done" value="true" />
    </target>

    <!-- general mockups task -->
    <target name="mockups" depends="mockups.compile" />



    <!-- ======================================================= -->
    <!-- PHASE 4 - Compile project code                          -->
    <!-- ======================================================= -->
    <!-- clean up source related areas -->
    <target name="compile.clean" description="Clean up source related areas" >
        <delete dir="${build.classes.dir}/${src.package.path}" quiet="true" />
        <delete dir="${build.xlib.dir}" quiet="true" />
        <delete dir="${build.temp.dir}" quiet="true" />
    </target>

    <!-- init source areas -->
    <target name="compile.init" description="Prepare everything for build" >
        <mkdir dir="${build.dir}" />
        <mkdir dir="${build.classes.dir}" />
        <mkdir dir="${build.xlib.dir}" />
        <mkdir dir="${unit.test.dir}" />
        <mkdir dir="${unit.test.reports.dir}" />
    </target>

    <!-- generate event classes (this generates, but does not compile them) -->
    <target name="compile.build_events" depends="compile.init"
            description="Build event classes that conform to the structure defined in an xml file" >
        <taskdef name="events" classname="org.enhydra.barracuda.taskdefs.EventBuilder" classpathref="build.classpath" />

        <!-- events -->
        <events
            srcdir="${build.source.event.dir}"
            destdir="${build.classes.dir}"
            classpathref="build.classpath"
            descriptor="${build.dir}/event-hierarchy.xml"
        />
    </target>

    <!-- compile the project source -->
    <target name="compile.compile_src" depends="mockups, compile.build_events"
            description="Compile the project source files" >
        <javac srcdir="${src.dir}"
            destdir="${build.classes.dir}"
            includes="**/*.java"
            excludes="**/old*/**,
                      ${src.package.path}/taskdefs/**"
            classpathref="build.full.classpath"
            debug="${build.debug}"
            optimize="${build.optimize}"
            deprecation="${build.deprecation}"
            verbose="${build.verbose}"
        />
    </target>

    <!-- post compile processing -->
    <target name="compile.post_process" >
        <!-- copy assorted files to the classes directory -->
        <copy todir="${build.classes.dir}/${src.package.path}" >
          <fileset dir="${src.dir}/${src.package.path}" >
             <include name="**/*.properties" />
             <include name="**/*.directives" />
             <include name="**/character-sets*" />
          </fileset>
        </copy>

        <!-- copy dtds into the xlib resources directory -->
        <copy todir="${build.xlib.dir}/dtds" >
          <fileset dir="${dtds.dir}" />
        </copy>

        <!-- copy scripts into the xlib resources directory -->
        <copy todir="${build.xlib.dir}/${src.scripts.path}" >
          <fileset dir="${src.dir}/${src.scripts.path}" />
        </copy>
    </target>

    <!-- compile the whole shebang -->
    <target name="compile" description="Compile Project" >
        <antcall target="compile.compile_src"/>
        <antcall target="compile.post_process"/>
    </target>
    <target name="compile.all" description="Compile Project and Tests" >
        <antcall target="test.compile"/>
    </target>



    <!-- ======================================================= -->
    <!-- Phase 5 - Unit Tests                                    -->
    <!-- ======================================================= -->
    <!-- clean up unit test related areas -->
    <target name="test.clean" description="Clean up unit test related areas" >
        <delete dir="${unit.test.dir}" quiet="true" />
        <delete dir="${unit.test.reports.dir}" quiet="true" />
        <delete dir="${build.test.classes.dir}" quiet="true" />
    </target>

    <!-- setup up unit test related areas -->
    <target name="test.setup" description="Setup up unit test related areas" >
        <mkdir dir="${build.test.classes.dir}" />
        <copy todir="${build.test.classes.dir}/${src.package.path}" >
          <fileset dir="${src.tests.dir}/${src.package.path}" >
             <include name="**/*.properties" />
          </fileset>
        </copy>
    </target>

    <!-- compile unit tests -->
    <target name="test.compile" depends="init,test.setup,compile" description="Compile any unit tests" >
        <javac srcdir="${src.tests.dir}"
            destdir="${build.test.classes.dir}"
            includes="**/*.java"
            excludes="**/old*/**"
            classpathref="build.full.classpath"
        />
    </target>

    <!-- fileset for all test files -->
    <fileset dir="${src.tests.dir}" id="test.files">
      <include name="**/Test*.java" />
      <exclude name="**/TestUtil.java" />
    </fileset>

    <!-- define the junit taskdef -->
    <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" />

    <!-- parameterised Batch Test Case (use: ant -Dbatchtest=name of fileset test.batch) -->
    <target name="test.batch" if="batchtest" description="Runs the JUnit batch test using the specified fileset">
        <junit printsummary="yes" haltonfailure="${junit.haltonfailure}" fork="yes" dir="${unit.test.dir}">
            <classpath refid="build.full.classpath"/>
            <sysproperty key="log4j.configuration" value="file:${build.dir}/log4j.xml" />
            <formatter type="xml" usefile="yes" />
            <formatter type="plain" usefile="no" />
            <batchtest todir="${unit.test.reports.dir}">
                <fileset refid="${batchtest}"/>
            </batchtest>
        </junit>
        <antcall target="test.report.html">
            <param name="do.unit.test.reports.dir" value="1" />
        </antcall>
    </target>

    <!-- run a Test Case (use: ant -Dtestcase=com.whatever.TestCaseName test.case) -->
    <target name="test.case" if="testcase" description="Runs the specified JUnit test case">
        <junit printsummary="yes" haltonfailure="${junit.haltonfailure}" fork="yes" dir="${unit.test.dir}">
            <classpath refid="build.full.classpath"/>
            <sysproperty key="log4j.configuration" value="file:${build.dir}/log4j.xml" />
            <formatter type="xml" usefile="yes" />
            <formatter type="plain" usefile="no" />
            <test name="${testcase}" todir="${unit.test.reports.dir}"/>
        </junit>
        <antcall target="test.report.html"/>
    </target>

    <!-- convert the junit xml files to html -->
    <target name="test2.report.html">
        <antcall target="test.report.html">
            <param name="do.unit.test.reports.dir" value="1" />
        </antcall>
    </target>
    <target name="test.report.html" if="do.unit.test.reports.dir" description="Convert the junit xml files to html" >
        <junitreport todir="${unit.test.reports.dir}">
            <fileset dir="${unit.test.reports.dir}">
                <include name="TEST-*.xml"/>
            </fileset>
            <report format="frames" todir="${unit.test.reports.dir}"/>
        </junitreport>
    </target>

    <!-- run all unit tests in batch mode -->
    <target name="test" depends="test.compile" description="Run all unit tests in batch mode" >
        <antcall target="test.batch">
            <param name="batchtest" value="test.files"/>
        </antcall>
        <exec executable="explorer">
            <arg file="${unit.test.reports.dir}/index.html"/>
        </exec>
    </target>



    <!-- ======================================================= -->
    <!-- Phase 6 - Make Jar files                                -->
    <!-- ======================================================= -->
    <!-- make a basic distribution -->
    <target name="jars" depends="compile.all" description="Make the project jar files without running the unit tests" >
        <!-- project jar -->
        <jar jarfile="${build.lib-cvs.dir}/${app.short.name}.jar" basedir="${build.classes.dir}"
             includes="${src.package.path}/**,
                       xlib/**"
             excludes="${src.package.path}/taskdefs/**"
         />
    </target>

    <!-- make a tested distribution -->
    <target name="jar.tested" depends="test, jars"
            description="Unit test everything and if ok make the project jar files" >
    </target>



    <!-- ======================================================= -->
    <!-- Phase 7 - Make Javadocs                                  -->
    <!-- ======================================================= -->
    <target name="javadoc" description="Create the javadocs" >
        <mkdir dir="${build.javadocs.dir}"/>
        <javadoc packagenames="${javadoc.packages}"
                 sourcepath="${src.dir}"
                 classpathref="build.full.classpath"
                 destdir="${build.javadocs.dir}"
                 additionalparam="-breakiterator -linksource"
                 author="true"
                 version="true"
                 use="true"
                 windowtitle="${app.name} API"
                 doctitle="${app.name}"
                 bottom="Copyright &#169; ${app.year} ${company.name}"
                 failonerror="true">

            <link href="${kilimanjaro.build.javadocs.dir}"/>
            <link href="http://barracudamvc.org/Barracuda/javadocs"/>
            <link href="http://java.sun.com/j2se/1.4.1/docs/api"/>
        </javadoc>
    </target>



    <!-- ======================================================= -->
    <!-- Phase 8 - Deploy the application                        -->
    <!-- ======================================================= -->
    <target name="deploy" depends="jars" description="Deploy without cleaning or running tests">
        <copy todir="${deploy.root.dir}" >
            <fileset dir="${root.dir}" includes="splash/**" />
        </copy>
        <copy file="${build.dir}/event-gateways.xml" todir="${deploy.build.dir}"/>
        <copy file="${build.temp.dir}/${app.short.name}.jar" todir="${deploy.build.lib-cvs.dir}"/>
        <copy todir="${deploy.build.lib-cvs.dir}">
            <fileset dir="${build.lib-cvs.dir}" includes="*.jar"/>
        </copy>
        <copy todir="${deploy.build.dir}">
            <fileset dir="${build.dir}"/>
            <mapper type="glob" from="sample.*" to="*"/>
        </copy>
        <unzip dest="${deploy.build.dir}">
            <fileset dir="${build.dir}" includes="sample.*.zip"/>
        </unzip>
        <ant dir="${deploy.build.dir}/bin" target="install" inheritAll="false"/>
    </target>

    <target name="deploy.tested" depends="clean"
            description="Deploy by first doing a clean, compile, and ensuring all unit tests are successful">
        <antcall target="jar.tested">
            <param name="junit.haltonfailure" value="yes"/>
        </antcall>
        <antcall target="deploy"/>
    </target>



    <!-- ======================================================= -->
    <!-- Miscellaneous targets                                   -->
    <!-- ======================================================= -->
    <target name="execute" description="Execute a class file">
        <input addproperty="exec.class">Enter full class name (i.e. com.atmr.atmreports.FooBar):</input>
        <input addproperty="exec.args">Arguments:</input>
        <java classname="${exec.class}"
              args="${exec.args}"
              fork="true"
              dir="${src.dir}"
              failonerror="true"
              classpathref="build.full.classpath"/>
    </target>

    <target name="cvt.trandb" description="Convert data from the old system to the new system">
        <java classname="com.atmr.atmreports.cvt.CvtAll"
              fork="true"
              dir="${src.dir}"
              failonerror="true"
              classpathref="build.full.classpath"/>
    </target>

    <target name="junit" description="Open JUnit for executing tests">
        <java classname="junit.swingui.TestRunner"
              fork="true"
              dir="${unit.test.dir}"
              classpathref="build.full.classpath">
        </java>
    </target>

    <target name="full_scrub_build" description="Do a clean, compile, and rebuild_db">
        <antcall target="clean"/>
        <antcall target="compile"/>
        <antcall target="db.rebuild"/>
    </target>

    <target name="java2html" description="Generate browseable HTML files from the Java source code">
        <taskdef name="java2html" classname="com.Ostermiller.Syntax.ToHTMLAntTask" classpath="${build.jar.dir}/syntax.jar"/>
        <java2html destdir="${build.javadocs.dir}"
                   srcdir="${src.dir}"
                   includes="**/*.java"
                   excludes="**/old*/**"
                   css="file://${bin.dir}/syntax.css"
        />
    </target>

    <target name="clean_imports.all" description="Clean up import statements on all source files">
        <taskdef name="cleanimports" classname="com.tombrus.cleanImports.ant.CleanImports" classpath="${build.jar.dir}/cleanImports.jar"/>
        <cleanimports srcdir="${src.dir}"
                      includes="**/*.java"
                      excludes="**/old*/**"
                      classpathref="build.full.classpath">
            <cleanformat>
                <options collapseAbove="0" blankLines="1" ambiguities="on"/>
                <import comment="java imports:" regexp="javax?\..+"/>
                <import comment="3rd-party imports:"/>
                <import comment="kilimanjaro imports:" package="com.atmr.kilimanjaro"/>
                <import comment="atmreports imports:" package="com.atmr.atmreports"/>
            </cleanformat>
        </cleanimports>
        <cleanimports srcdir="${src.tests.dir}"
                      includes="**/*.java"
                      excludes="**/old*/**"
                      classpathref="build.full.classpath">
            <cleanformat>
                <options collapseAbove="0" blankLines="1" ambiguities="on"/>
                <import comment="java imports:" regexp="javax?\..+"/>
                <import comment="3rd-party imports:"/>
                <import comment="kilimanjaro imports:" package="com.atmr.kilimanjaro"/>
                <import comment="atmreports imports:" package="com.atmr.atmreports"/>
            </cleanformat>
        </cleanimports>
    </target>

    <target name="clean_imports.single" description="Clean up import statements on a single source file">
        <taskdef name="cleanimports" classname="com.tombrus.cleanImports.ant.CleanImports" classpath="${build.jar.dir}/cleanImports.jar"/>
        <dialog verbose="off">
            <input property="clean_imports.file" text="Path of file to clean, relative to package root (e.g. screens/Businesses.java): " type="string"/>
        </dialog>
        <cleanimports srcdir="${src.dir}"
                      includes="${src.package.path}/${clean_imports.file}"
                      classpathref="build.full.classpath">
            <cleanformat>
                <options collapseAbove="0" blankLines="1" ambiguities="on"/>
                <import comment="java imports:" regexp="javax?\..+"/>
                <import comment="3rd-party imports:"/>
                <import comment="kilimanjaro imports:" package="com.atmr.kilimanjaro"/>
                <import comment="atmreports imports:" package="com.atmr.atmreports"/>
            </cleanformat>
        </cleanimports>
    </target>

    <target name="clean_imports.single_test" description="Clean up import statements on a single test case source file">
        <taskdef name="cleanimports" classname="com.tombrus.cleanImports.ant.CleanImports" classpath="${build.jar.dir}/cleanImports.jar"/>
        <dialog verbose="off">
            <input property="clean_imports.file" text="Path of file to clean, relative to package root (e.g. screens/Businesses.java): " type="string"/>
        </dialog>
        <cleanimports srcdir="${src.tests.dir}"
                      includes="${src.package.path}/${clean_imports.file}"
                      classpathref="build.full.classpath">
            <cleanformat>
                <options collapseAbove="0" blankLines="1" ambiguities="on"/>
                <import comment="java imports:" regexp="javax?\..+"/>
                <import comment="3rd-party imports:"/>
                <import comment="kilimanjaro imports:" package="com.atmr.kilimanjaro"/>
                <import comment="atmreports imports:" package="com.atmr.atmreports"/>
            </cleanformat>
        </cleanimports>
    </target>

    <target name="checkstyle.all" description="Make sure all source files adhere to coding standards">
        <taskdef classpath="${build.jar.dir}/checkstyle-all-3.1.jar" resource="checkstyletask.properties"/>
        <checkstyle config="checkstyle.xml">
            <fileset dir="${src.dir}" includes="**/*.java" excludes="**/old*/**"/>
            <fileset dir="${src.tests.dir}" includes="**/*.java" excludes="**/old*/**"/>
            <formatter type="plain"/>
            <formatter toFile="checkstyle_errors.xml" type="xml"/>
        </checkstyle>
    </target>

    <target name="checkstyle.single" description="Check a single source file for adherence to coding standards">
        <taskdef classpath="${build.jar.dir}/checkstyle-all-3.1.jar" resource="checkstyletask.properties"/>
        <dialog verbose="off">
            <input property="checkstyle.file" text="Path of file to check, relative to package root (e.g. screens/Businesses.java): " type="string"/>
        </dialog>
        <checkstyle config="checkstyle.xml"
                    file="${src.dir}/${src.package.path}/${checkstyle.file}">
            <formatter type="plain"/>
        </checkstyle>
    </target>

    <target name="checkstyle.single_test" description="Check a single test case source file for adherence to coding standards">
        <taskdef classpath="${build.jar.dir}/checkstyle-all-3.1.jar" resource="checkstyletask.properties"/>
        <dialog verbose="off">
            <input property="checkstyle.file" text="Path of file to check, relative to package root (e.g. screens/Businesses.java): " type="string"/>
        </dialog>
        <checkstyle config="checkstyle.xml"
                    file="${src.tests.dir}/${src.package.path}/${checkstyle.file}">
            <formatter type="plain"/>
        </checkstyle>
    </target>
</project>

<!--
 ************************************ BEGIN COMMIT LOGS ********************************************
 $Log: build.xml,v $
 Revision 1.35  2003/08/08 19:49:26  christianc
 csc_080803_1 - Added a new ant_9_cvt_trandb.bat to easily run cvt outside of an IDE.

 Revision 1.34  2003/08/07 16:26:39  christianc
 Get the build files working for both mockups and mockups_help directories

 Revision 1.33  2003/07/21 20:29:11  christianc
 csc_072103_1 - New version of Kilimanjaro that utilizes statement caching, fixes a bug in the
                NetDirect drivers. Note that this will require you to update from the Resources
                cvs tree and to install the contents of JSQLConnect3_3017_trial.zip into your
                Tomcat shared/lib directory.

 Revision 1.32  2003/07/01 20:45:10  shawnw
 Small adjustment to the "deploy" build target

 Revision 1.31  2003/06/11 15:41:21  shawnw
 Moved commit log comments to bottom of build file

 Revision 1.30  2003/06/09 23:39:32  shawnw
 Misc. updates to build process (modifications to checkstyle and clean imports tasks)

 Revision 1.29  2003/06/05 23:43:08  shawnw
 Modifications to build process so that source code can be checked for style/code-convention issues

 Revision 1.28  2003/06/04 21:32:03  shawnw
 saw_060403_3 - Modifications to build process to allow rebuilding of the database and cleaning the
                import statements of source files. Includes latest kilimanjaro (saw_060403_1) with
                new taskdef. Also added kilimanjaro-ant.jar to CVS.

                This update requires you to re-extract the "jakarta-ant-1.5.1-patched.zip" file found
                in the Resources tree.

 Revision 1.27  2003/05/27 22:14:21  christianc
 csc_052703_2 - New version of Barracuda 2.2, which contains the new SoftHashMap stuff for
                better caching. Also a new version of Kilimanjaro, which uses the soft map rather
                than weak map for caching.

 Revision 1.26  2003/05/12 17:12:57  shawnw
 Update build script so ant reports failure when javadocs fail

 Revision 1.25  2003/05/12 17:02:28  christianc
 csc_051203_1 - Latest round of changes for Contract list stuff

 Revision 1.24  2003/05/02 17:04:50  shawnw
 Added new targets to the build script:
    - "execute" to execute any executable Java class in the build classpath
    - "junit" to open the JUnit GUI (still some Log4J issues to be worked out)

 Revision 1.23  2003/05/01 22:03:21  shawnw
 Change default target in build script from "jars" to "compile.all"

 Revision 1.22  2003/04/18 17:42:59  shawnw
 Updated the batch test target so that test results are displayed after completion.

 Revision 1.21  2003/04/02 15:20:08  christianc
 csc_040203_1 - Upgrade to a new version of Barracuda, XMLC 2.2. Note that this
                will require some changes to your Tomcat and Ant installs.

                1. Delete your Jakarta Ant installation, and then reextract
                jakarta-ant-1.5.1-patched.zip (from the Resources cvs tree) into
                E:/Utilities. This should reset Ant to a fairly stock installation (no
                more custom xerces jars)

                2. Stop Tomcat. Delete everthing beneath CATALINA_HOME's /common/endorsed
                and /shared/lib. Rextract tomcat_config_patch.zip (again, in the Resources
                tree) into D:/. This should reset Tomcat to a fairly stock installation (no
                more custom xerces jars)

                3. Update Barracuda, Kilimanjaro, NxGen, and ATMReportsDev from cvs and
                recompile. You should be able to start Tomcat after this and proceed without
                difficulties.

                This new version of Barracuda contains a fix to HttpSessionStateMap to fix
                a null pointer exception Shawn discovered.

 Revision 1.20  2003/03/12 18:57:40  shawnw
 Updated the build process as follows:
    - New "deploy.tested" target does clean, compile, & test before deploying
    - Modified test batch target so that output also gets sent to stdout
    - Updated batch files to use a Log4jListener for logging, to display output on stdout, and to wait for key press when finished
    - Misc. other updates

 Revision 1.19  2003/03/05 15:54:03  christianc
 *** empty log message ***

 Revision 1.18  2003/02/25 16:14:26  shawnw
 Updated mockups.deploy task so that stylesheets and images do not have mappings applied to tokens. Also updated copyright info in header and added "Log" tag.

 ************************************* END COMMIT LOGS *********************************************
-->
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.