logo       

[Re: Enhydra5.1 and XMLC]: msg#00038

java.enhydra.general

Subject: [Re: Enhydra5.1 and XMLC]


Hi,

As per the referred message plus the advice of Petr, I tried to find a line in my build file that may delete the previously compiled html files/directory.

In my buid.xml file, only target that seems to delete all compiled directories is "clean", and "rebuild" is depedent to it. It does not look that rebuild is called in normal compile process, but every time I compile, compilation seems to be done from the scratch.

The following is the content of my build file:


<?xml version="1.0"?>

<!-- ===================================================================

Build file for TextVersion

Notes:
This is a build file for use with the Jakarta Ant and the ant script
provided with Lutris EAS.

Build Instructions:
To build, run

<enhydra_root>bin/ant <target>
on the directory where this file is located with the target you want.

Most useful targets:

- make -> create ./output (default)
- rebuild -> create ./output from scratch
- clean -> remove all files from ./classes and ./output
- compile -> compile source to ./classes with javac and xmlc
- javadocs -> creates the javadocs in "./output/javadocs"



==================================================================== -->

<project name="TextVersion"
default="make"
basedir=".">

<taskdef name="dods" classname="org.enhydra.ant.taskdefs.Dods"/>
<!-- =================================================================== -->
<!-- Initialize the properties -->
<!-- =================================================================== -->

<!-- Set up application values -->
<property name="project.name" value="TextVersion"/>
<property name="project.package" value="textVersion"/>
<property name="project.version" value="1.0"/>
<property name="project.year" value="2004"/>

<!-- directory locations -->
<property name="dir.package" value="textVersion"/>
<property name="enhydra.root" value="/usr/local/enhydra5.1"/>
<property name="enhydra.dir" location="/usr/local/enhydra5.1"/>
<property name="dir.classes" location="classes"/>
<property name="dir.input" location="input"/>
<property name="dir.java" location="${java.home}/../" />
<property name="dir.src" location="src"/>
<property name="dir.output" location="output"/>
<property name="dir.content" location="${dir.output}/content"/>
<property name="dir.project" location="."/>
<property name="dir.lib" location="${dir.output}/lib"/>
<property name="dir.javadocs" location="${dir.output}/javadocs"/>
<property name="dir.xmlc" location="${dir.classes}/Generated Source/"/>
<!-- Slobodan Vujasinovic 08.08.03.-->
<taskdef name="xmlc" classname="org.enhydra.xml.xmlc.taskdef.Xmlc">
<classpath>
<path location="${enhydra.dir}/build/xmlc-taskdef.jar"/> </classpath>
</taskdef>
<!-- Slobodan Vujasinovic 08.08.03.-->
<!-- DODS -->
<property name="dodsbuild.dir" value="${dir.src}/textVersion/data"/>

<property name="xmlc.dir" value="${enhydra.root}/bin"/>
<property name="xmlcbuild.dir" value="${dir.src}/textVersion/presentation"/>
<property name="xmlcresources.dir" value="${dir.src}/textVersion/resources"/>
<property name="enhydra.liboutput" value="${dir.output}/lib"/>
<property name="library.dir" value="${enhydra.root}/lib"/>

<!-- DODS -->
<!-- If dods is used? if yes, please set your database's doml file name
-->
<!-- in file dods.properties: dods.doml=yourDataBase.doml -->
<property file="dods.properties"/>

<!-- debug setting -->
<property name="debug" value="on"/>

<!-- javadoc package -->
<property name="packages" value="textVersion.*"/>

<!-- =================================================================== -->
<!-- Set up javac class path -->
<!-- =================================================================== -->
<path id="javac.classpath">
<fileset dir="${enhydra.liboutput}" >
<include name="*.jar" />
</fileset>
</path>

<!-- =================================================================== -->
<!-- Create output (default) -->
<!-- =================================================================== -->
<target name="make" depends="archive,output" />

<!-- =================================================================== -->
<!-- Create output from scratch (no javadoc) -->
<!-- =================================================================== -->
<target name="rebuild" depends="clean,make" />

<!-- =================================================================== -->
<!-- Prepare the directory tree -->
<!-- =================================================================== -->
<target name="prepare">
<mkdir dir="${dir.output}"/>
<mkdir dir="${dir.lib}"/>
<mkdir dir="${dir.content}"/>
<mkdir dir="${dir.content}/WEB-INF"/>
<mkdir dir="${dir.content}/WEB-INF/lib"/>
<mkdir dir="${dir.classes}"/>
<mkdir dir="${dir.xmlc}"/>

<!-- DODS -->
<!-- What is the script extension - OS dependant -->
<condition property="script_extension" value="">
<os family="unix"/>
</condition>
<condition property="script_extension" value=".bat">
<os family="windows"/>
</condition>

</target>

<!-- ========================================================= -->
<!-- DODS: generate database manuplation java class -->
<!-- ========================================================= -->
<target name="dods" depends="prepare" if="dods.doml">
<dods domlfile="${dir.project}/${dods.doml}"
outputDir="${dodsbuild.dir}"
action="dods:java"/>
<copy todir="${dir.classes}">
<fileset dir="${dodsbuild.dir}/classes" />
</copy>
</target>
<!-- =================================================================== -->
<!-- Compile documents with XMLC -->
<!-- =================================================================== -->
<!-- DODS -->
<!--
<target name="xmlc" depends="prepare">
--> <target name="xmlc" depends="prepare, dods">
<xmlc srcdir="${xmlcresources.dir}"
sourceout="${dir.xmlc}"
packagename="${project.package}.presentation"
options="options.xmlc"
compile="true"
includes="**/*.html">
<arg value="-d" />
<arg value="${dir.classes}" />
</xmlc>
</target> <!-- =================================================================== -->
<!-- Compile the java source -->
<!-- =================================================================== -->
<!-- DODS -->
<!-- <target name="compile" depends="prepare,xmlc"> -->
<target name="compile" depends="xmlc">
<!-- compile XMLC generated java source -->
<javac srcdir="${dir.src}"
destdir="${dir.classes}"
excludes="**/StartServer.java"
classpathref="javac.classpath"
debug="${debug}">
<!-- DODS -->
<classpath>
<pathelement location="${library.dir}/build/dods.jar" />
</classpath>
</javac>
</target>

<!-- =================================================================== -->
<!-- Create content for document root -->
<!-- =================================================================== -->
<target name="content" depends="prepare">
<copy todir="${dir.content}">
<fileset dir="${dir.src}/${dir.package}/resources">
<include name="**/*.css"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.js"/>
<include name="**/*.jsp"/>
<include name="**/*.properties"/>
</fileset>
</copy>
</target>

<!-- =================================================================== -->
<!-- Prepare output files -->
<!-- =================================================================== -->
<target name="output" depends="prepare,content">
<filter token="ENHYDRA_PATH" value="${enhydra.root}" />
<filter token="JAVA_PATH" value="${dir.java}" />
<filter token="DEPLOY_PATH" value="${dir.output}" />
<filter token="PROJECT_PATH" value="${dir.project}" />
<filter token="ENHYDRA_DIR" value="${enhydra.dir}" />

<copy todir="${dir.output}"
filtering="off">
<fileset dir="${dir.input}">
<exclude name="**/*.in"/>
</fileset>
</copy>
<copy todir="${dir.output}"
filtering="on">
<fileset dir="${dir.input}">
<include name="**/*.in"/>
</fileset>
</copy>

<move file="${dir.output}/run.in"
tofile="${dir.output}/run"/>
<move file="${dir.output}/run.bat.in"
tofile="${dir.output}/run.bat"/>
<move file="${dir.output}/conf/multiserver.conf.in"
tofile="${dir.output}/conf/multiserver.conf"/>
<move file="${dir.output}/conf/log4j.xml.in"
tofile="${dir.output}/conf/log4j.xml"/>
<copy file="${dir.src}/WEB-INF/web.xml"
tofile="${dir.content}/WEB-INF/web.xml"/>
<copy file="${enhydra.dir}/lib/barracuda-core.jar"
tofile="${dir.content}/WEB-INF/lib/barracuda-core.jar"/> <copy file="${enhydra.dir}/lib/plankton.jar"
tofile="${dir.content}/WEB-INF/lib/plankton.jar"/>
<copy file="${enhydra.dir}/lib/log4j-1.2.8.jar"
tofile="${dir.content}/WEB-INF/lib/log4j-1.2.8.jar"/>
<copy file="${enhydra.dir}/lib/xmlc.jar"
tofile="${dir.content}/WEB-INF/lib/xmlc.jar"/>
<replace token="\"
value="/"
dir="${dir.output}"
includes="**/*.properties,**/*.conf,**/log4j.xml"/>

<chmod file="${dir.output}/run" perm="ugo+rx"/>

</target>


<!-- =================================================================== -->
<!-- Create archive -->
<!-- =================================================================== -->
<target name="archive" depends="prepare,compile">
<mkdir dir="${dir.lib}/tmp" />
<copy todir="${dir.lib}/tmp" includeEmptyDirs="No">
<fileset dir="${dir.classes}" excludes="**/*.java"/>
</copy>
<war warfile="${dir.lib}/${project.name}.war"
webxml="${dir.src}/WEB-INF/web.xml">
<classes dir="${dir.lib}/tmp"
excludes="**/*.java"/>
<fileset dir="${dir.content}"/>
</war>
<delete dir="${dir.lib}/tmp" /> </target>
<!-- =================================================================== -->
<!-- Create the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare">
<mkdir dir="${dir.javadocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${dir.src}"
destdir="${dir.javadocs}"
author="true"
version="true"
use="true"
windowtitle="${project.name} API"
doctitle="${project.name}"
bottom="Copyright &#169; ${project.year}"/>
</target>

<!-- =================================================================== -->
<!-- Clean everything -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${dir.lib}"/>
<delete dir="${dir.classes}"/>
<delete dir="${dir.output}"/>
<delete dir="${dir.xmlc}"/>
<delete quiet="true">
<fileset dir="." includes="*.uptodate" />
</delete>
<delete dir="${dodsbuild.dir}/classes"/>
</target>

</project>

I appreciate if some one on the list can give me some pointers on what is going on in my build.xml file.

My apology for the lengthy message.

Damar
--- Begin Message ---
Subject: RE: Enhydra: Enhydra5.1 and XMLC
There was just a thread about this on the list:

http://enhydra.enhydra.org/project/mailingLists/enhydra/200312/msg00032.
html

I'm still using 3.1 (I know, I know), so I can't give you any more
details.

-----Original Message-----
From: enhydra-admin@xxxxxxxxxxx [mailto:enhydra-admin@xxxxxxxxxxx] On
Behalf Of Thapa Damar
Sent: Saturday, December 27, 2003 9:04 PM
To: enhydra@xxxxxxxxxxx
Subject: Enhydra: Enhydra5.1 and XMLC


Hi,

I am using Enhydra5.1 to build a barracuda based website. Every thing is

working fine, except one thing ie during the development, when I change
the code (just java codes, not html files), and recompile with ant, it
recompiles the whole thing (including all html files), even though no
changes are made and they were already compiled in earlier compilation.

I had used enhydra5.0 in the past, and it used to compile only changed
files. Is there any thing I can change, so that enhydra5.1 can do the
same?

Any pointers would be highly appreciated.

Damar

_______________________________________________
Enhydra mailing list
Enhydra@xxxxxxxxxxx http://www.enhydra.org/mailman/listinfo.cgi/enhydra

_______________________________________________
Enhydra mailing list
Enhydra@xxxxxxxxxxx
http://www.enhydra.org/mailman/listinfo.cgi/enhydra


--- End Message ---
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise