RE: Using XDoclet with Magic

"Stephen McConnell" <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.user
Message-ID <000301c4a190$c2eef7e0$1601a8c0@gloria>
Best approach is to create a new spell (magic plugin).  You can do this
by creating a new project containing the following build.xml:

  <?xml version="1.0" encoding="UTF-8" ?>
  <project name="my-xdoclet-spell" default="install" basedir="." 
      xmlns:x="antlib:org.apache.avalon.tools">
    <x:home/>
    <import file="${magic.templates}/standard.xml"/>
    <target name="build" depends="standard.build">
      <x:declare/>
    </target>
  </project>

The <x:declare> target will generate a plugin descriptor using
information about the "my-xdoclet-spell" declared in you index.xml file.
The following is an example of a <plugin> declaration in index.xml:

  <plugin basedir="somewhere/xdoclet">
    <info>
      <group>somewhere</group>
      <name>my-xdoclet-spell</name>
      <type>plugin</type>
    </info>
    <dependencies>
      <include key="hybernate"/>
    </dependencies>
    <tasks>
      <taskdef name="xdoclet" class="org.hybernate.whatever.TaskThing"/>
    </tasks>
  </plugin>

The important point is to declare the taskdef in the plugin definition
such that it refers to a valid task class in the classpath declared by
the plugin descriptor.  With the above I place ... you can use your
plugin task inside a build.xml as follows:

  <target name=" xdoclet" depends="prepare">
    <x:plugin name="xdoclet" 
       uri="plugin: somewhere/xdoclet/my-xdoclet-spell "/>
    <xdoclet/>
  </target>

Cheers, Steve.


> -----Original Message-----
> From: David Leangen [mailto:[email protected]]
> Sent: 23 September 2004 17:58
> To: [email protected]
> Subject: Using XDoclet with Magic
> 
> 
> I'd like to use XDoclet with my build. Is there already a mechanism
for
> this?
> 
> Specifically, I am using the Hibernate task.
> 
> 
> Has anybody already done this?
> 
> 
> Thanks!
> 
> 
> 
> ---------------------------------------------------------------------
> 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.