Building Events
"Adam J Chesney" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <019c01c3245d$b8879e80$1b9dbdc0@zultan> |
Hi, I am trying to produce an ant build file to just build and compile some events from a specific events.xml file. I started by cutting down the main barracuda build.xml file and threw out all of the stuff that I thought I didn't need. I ended up with the attached build file, and everything seems okay except that when the event classes get compiled I get the following error message: a.. "ApplicationRequest.java": [events] C:\Dev\xmltravel\ViewdataService\tmp$\src_events\com\xmltravel\viewdata\events\ApplicationRequest.java:29: error #302: cannot access class org.enhydra.barracuda.core.event.HttpRequestEvent; neither class nor source found for org.enhydra.barracuda.core.event.HttpRequestEvent at line 29 From the looks of it the event base class is not found during compilation. After trying various different strategies for updating the class path that Ant is using during the EventBuilder task I have not managed to overcome this problem. Now, the weird bit is that as far as I can determine, the regular Barracuda build process should have the same problem unless I am mistaken (which I almost certainly am). The build.classpath (used as the classpath for the event building task) consists of the jars in the Jars directory and the log4J jar in the lib-cvs directory, neither of which would include the standard event base-class (org.enhydra.barracuda.core.event.HttpRequestEvent). Therefore, I must assume that other paths are also added for that process. I am new to Ant so this is the bit that I don't understand. When the event classes are compiled during the main Barracuda build process where do the event base classes come from? If I am not building the whole of barracudda and I just want to build my events, what should my classpath look like for the build_events.sub task? thanks for your help, Adam. ===================================================== Tel: (+44) 117 908 1254 (Direct) Mobile (+44) 7780 962 961 email: [email protected] This communication is intended solely for the addressee and is confidential. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Although this e-mail and any attachments are believed to be free of any virus, or any other defect which might affect any computer or IT system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by Multicom Products Limited for any loss or damage arising in any way from receipt or use thereof.
build_events.xml
(text/xml, 1.9 KB)
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Adam Chesney (Multicom Products Ltd) -->
<project name="VAOEvents" default="build_events" basedir=".">
<!-- Set up application info -->
<!-- root info -->
<property name="root.dir" location="${basedir}"/>
<!-- source files -->
<property name="src.dir" location="${root.dir}/src"/>
<property name="src.package.path" value="com/xmltravel/viewdata/"/>
<!-- build info -->
<property name="build.dir" location="${root.dir}"/>
<property name="build.lib.dir" location="${root.dir}/lib"/>
<property name="build.temp.dir" location="${build.dir}/tmp$"/>
<property name="build.event_source.dir" location="${build.temp.dir}/src_events/"/>
<property name="build.classes.dir" location="${build.dir}/classes"/>
<path id="build.classpath">
<!-- other development libraries -->
<fileset dir="${build.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<!-- generate event classes (this generates, but does not compile them) -->
<target name="build_events" description="Build event classes that conform to the structure defined in an xml file">
<!--Standard events -->
<antcall target="build_events.sub">
<param name="subdir" value="events/standard_events.xml"/>
</antcall>
</target>
<!-- generate event classes (this generates, but does not compile them) -->
<target name="build_events.sub" description="Build event classes that conform to the structure defined in an xml file">
<delete dir="${build.temp.dir}" quiet="true"/>
<mkdir dir="${build.event_source.dir}"/>
<taskdef name="events" classname="org.enhydra.barracuda.taskdefs.EventBuilder">
<classpath refid="build.classpath"/>
</taskdef>
<events srcdir="${build.event_source.dir}" destdir="${build.classes.dir}" descriptor="${src.dir}/${src.package.path}${subdir}"/>
</target>
</project>