On Thu, 11 Oct 2001 20:15:18 +1000, Peter Donald <[EMAIL PROTECTED]> wrote:
> On Thu, 11 Oct 2001 07:38, Ovidiu Predescu wrote:
> > On Thu, 11 Oct 2001 06:52:51 +1000, Peter Donald <[EMAIL PROTECTED]> wrote:
> > > On Thu, 11 Oct 2001 04:41, Sam Ruby wrote:
> > > > Ovidiu Predescu wrote:
> > > > > A simpler solution to the one proposed above is to this is to allow
> > > > > antlib to appear inside a <target> element. This way one can write
> > > > > the build.xml file that builds a new antlib in a target, and makes
> > > > > use of it in another target. Something like this:
> > > > > [snip]
> > > > > I'm not sure what are the implications with the current class loader
> > > > > mechanisms, but a solution can probably be worked out.
> > > >
> > > > I believe that some of the Ant 2.x designs are conducive to such an
> > > > approach, but the last time I looked, this was problematic with the
> > > > current design.
> > >
> > > It is already possible now ! ;)
> >
> > I would be very interested to see how ;-). Could you give an example?
>
>
> <javac .../>
> <jar .../>
> <taskdef .../>
>
> should work. It used to ... at one stage avalons build file did that. Not
> sure if anything has changed in ant to make this harder?
When I do this, I get an NPE in ProjectHelper:
java.lang.NullPointerException
at org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:651)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:143)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:178)
at
org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:139)
at
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:88)
at org.apache.tools.ant.Task.perform(Task.java:216)
at org.apache.tools.ant.Target.execute(Target.java:164)
at org.apache.tools.ant.Target.performTasks(Target.java:182)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.apache.tools.ant.Main.runBuild(Main.java:454)
at org.apache.tools.ant.Main.start(Main.java:153)
at org.apache.tools.ant.Main.main(Main.java:176)
The relevant fragment in my build.xml is:
<target name="soap-test" depends="jar">
<taskdef resource="META-INF/Anteater.tasks" classpathref="tomcat-run"/>
<http debug="0">
<comment>Post a simple SOAP request</comment>
<soapRequest
href="http://services.xmltoday.com/vx_engine/soap-trigger.pperl"
content="test/requests/get-quote2"
action="urn:vgx-realtime">
<match responseCode="200">
<xpath select="/SOAP-ENV:Envelope/SOAP-ENV:Body"/>
<header name="Date" property="result"/>
</match>
</soapRequest>
</http>
</target>
The "jar" target builds the jar file containing my new task
definitions. The "tomcat-run" reference contains in it the newly built
jar file.
If this used to work, I'll investigate to see what's going on. If you
have any ideas, I don't mind if you look at it too ;-)
Regards,
--
Ovidiu Predescu <[EMAIL PROTECTED]>
http://orion.rgv.hp.com/ (inside HP's firewall only)
http://sourceforge.net/users/ovidiu/ (my SourceForge page)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)