RE: Magic - included resources for custom Ant task (magic plugin?)

"Stephen McConnell" <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.user
Message-ID <001d01c4837b$b2df9630$1601a8c0@gloria>
Cameron:

If I understand correctly - what you need to do is to declare the
xsd2jibx as a resource with its associated dependencies.  

For example - in your index.xml (or wherever you have xsd2jibx declared)
you could do something like:

  <resource>
    <info>
      <group>xsd2jibx</group>
      <name>xsd2jibx</name>
    </info>
    <dependencies>
      <include key="log4j"/>
      <include key="jibx-run"/>
      <include key="xpp3" />
      <include key="commons-logging"/>
      <include key="jaxmejs"/>
    </dependencies>
  </resource>

Then inside you build.xml you can reference the BUILD path using the
following statement:

    <x:path key=" xsd2jibx" id="the-path"/>

The 'the-path' can now referenced as a refid argument in any ant task.
Fpr example:

   <taskdef name="xsd2jibx"
classname="org.jibx.xsd2jibx.GeneratorAntTask">
     <classpath>
       <path refid="the-path"/>
     </classpath>
   </taskdef>

Does this solve the problem?

Cheers, Steve.


> -----Original Message-----
> From: Cameron Taggart [mailto:[email protected]]
> Sent: 15 August 2004 21:54
> To: Avalon framework users
> Subject: Magic - included resources for custom Ant task (magic
plugin?)
> 
> Without understanding how to build a magic plugin, I went forward with
> creating ant tasks for my project, xsd2jibx, with standard ant
includes.
> http://cvs.sourceforge.net/viewcvs.py/jibx/xsd2jibx/ant-xsd2jibx-
> task.xml?rev=1.2&view=markup
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <project xmlns:x="antlib:org.apache.avalon.tools">
> 
>   <x:property name="xsd2jibx.path" key="xsd2jibx" feature="path"/>
>   <x:property name="xpp3.path" key="xpp3" feature="path"/>
>   <x:property name="jibx-run.path" key="jibx-run" feature="path"/>
>   <x:property name="commons-logging.path" key="commons-logging"
> feature="path"/>
>   <x:property name="jaxmejs.path" key="jaxmejs" feature="path"/>
>   <x:property name="log4j.path" key="log4j" feature="path"/>
> 
>   <path id="xsd2jibx.classpath">
>     <fileset dir="${magic.cache}" includes="
>        ${log4j.path},
>        ${xsd2jibx.path},
>        ${jibx-run.path},
>        ${xpp3.path},
>        ${commons-logging.path},
>        ${jaxmejs.path}"/>
>   </path>
> 
>   <taskdef name="xsd2jibx"
classname="org.jibx.xsd2jibx.GeneratorAntTask">
>     <classpath>
>       <path refid="xsd2jibx.classpath"/>
>     </classpath>
>   </taskdef>
> 
> </project>
> 
> 
> The issue that I run into is that other projects that wish to use
> xsd2jibx must reference all those resources.
> http://cvs.sourceforge.net/viewcvs.py/jibx/xsd2jibx/resources-
> common.xml?rev=1.3&view=markup
> 
> I was hoping that I could have some ant variables to work with in
> index.xml, but no such luck.
>   <import index="../xsd2jibx/magic/resources-common.xml"/>
>   <!--<import index="${xsd2jibx_home}/magic/resources-common.xml"/>-->
> 
> Is the magic plugin mechanism a better approach?  If yes, how can I
use
> it in this situation.
> 
> Thanks,
> Cameron
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.