Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

Re: taskdef question - only usable at project level?

Andrew n marshall

2008-03-12

Replies: Find Java Web Hosting

Author LoginPost Reply

I am also trying to develop something like what Scot described and
running into similar problems. However, I am not using the namespace
notation. My version looks something like this:

<target name="update" depends="define_svnant_tasks">
  <svn>
   <checkout url="${cpptasks.svn}" destPath="${cpptasks.dir}" />
  </svn>
</target>

<target name="define_svnant_tasks">
  <!-- Using ant-contrib's antfetch task to call targets and import resulting classpath -->
  <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
  <antfetch antfile="svnant.xml" target="define_svnant_classpath" return="svnant.classpath"/>
  <taskdef resource="svntask.properties">
   <classpath>
    <pathelement path="${svnant.classpath}" />
   </classpath>
  </taskdef>
  <echo>Defined &lt;svn&gt; task</echo>
</target>


I currently get the following error:
> define_svnant_classpath:
>    [echo] Defined <svn> task
>
> update:
>
> BUILD FAILED
> /Users/Anm/Projects/Development/ant_cpp_skeleton/lib/cpptasks.xml:19:
> java.lang.NoClassDefFoundError:
> org/tigris/subversion/javahl/ClientException


Matt Benson wrote:
> In Ant's distro (I think, else in SVN HEAD) you can check out the
> cooperation between fetch.xml and get-m2.xml . This does something
> like what you're talking about.
The main difference I see is the use of import. Instead, I avoid the
polluting the namespace by just <antfetch>ing the classpath before
defining the task. Still, the task definition is missing in the
depending target.



Anm



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.