Re: Localize taskdef shouldn't compile
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
At 09:34 AM 9/9/2003 -0600, you wrote:
>Sorry about missing the second part of your email, I think I just
>completely read over it :). Anyways, you are right that the compilation
>should probably be taken out of the events taskdef as well. I will work on
>getting that change implemented today.
If you haven't already implemented the change to the events taskdef, I've
attached a patch that should do it. Note that I changed the "srcdir"
parameter to "sourceout" to be consistent with other tasks and to better
describe its purpose. Here is how to define the <events> task now...
<events
sourceout="${build.event_source.dir}"
descriptor="${src.dir}/${src.package.path}${subdir}"
/>
I know this breaks backward compatibility, but this is the right way set
things up. Let me know if anyone has concerns. It shouldn't be too hard
to for people to update their builds. Make sure to add the sourceout
directory to the list of things to compile in the "compile_rest" target
(either colon-separated in the "srcdir" attribute or with nested <src
path="..."/> elements). Note that I haven't checked this in yet.
Jake
Index: src/org/enhydra/barracuda/taskdefs/EventBuilder.java
===================================================================
RCS file: /var/cvs/Barracuda/src/org/enhydra/barracuda/taskdefs/EventBuilder.java,v
retrieving revision 1.11
diff -u -r1.11 EventBuilder.java
--- src/org/enhydra/barracuda/taskdefs/EventBuilder.java 1 Sep 2003 14:37:25 -0000 1.11
+++ src/org/enhydra/barracuda/taskdefs/EventBuilder.java 9 Sep 2003 22:52:54 -0000
@@ -52,7 +52,7 @@
*
* @author Christian Cryder <a href="mailto:[email protected]">[email protected]</a>
*/
-public class EventBuilder extends Javac {
+public class EventBuilder extends Task {
//private constants
private static final String DEFAULT_PARSER = "org.apache.xerces.parsers.SAXParser";
@@ -60,6 +60,7 @@
//private vars
protected String parserClass = null;
protected File xmlFile = null; //the xml file
+ protected String sourceOutDir = null; //the directory where source is generated
/**
* Sets the xml event descriptor file.
@@ -67,6 +68,13 @@
public void setDescriptor(File xmlFile) {
this.xmlFile = xmlFile;
}
+
+ /**
+ * Sets directory where source is generated.
+ */
+ public void setSourceout(String sourceOutDir) {
+ this.sourceOutDir = sourceOutDir;
+ }
/**
* Parse the specified event.xml file, generate event classes from
@@ -113,9 +121,6 @@
//finally, make sure we clean up any accessed resources
if (resolver!=null) resolver.cleanup();
}
-
- //finally, compile the newly created files
- super.execute();
}
/**
@@ -355,7 +360,7 @@
protected boolean buildEventFile() {
//first of all, see if we need to create a new event file
String targetPackage = cs.eventPackage.replace('.','/');
- File targetPath = new File(getSrcdir()+"/"+targetPackage);
+ File targetPath = new File(sourceOutDir+"/"+targetPackage);
File targetFile = new File(targetPath.toString(), cs.eventName+".java");
//if the target path does not exist create it