Hi Steve & Niclas, I flagged this email last month, knowing that I would eventually have some questions. I have common Ant tasks that I want to use throughout various projects.
Eclipse task - Creates a .classpath & .project file for Eclipse with all the resources definied in Magic. Jetty task - Starts up Jetty with and loads a .war. Docbook task - Creates HTML and PDF from our docbook documentation for the project. Those are just a few that we use regularly. I thought they might make good plugins, but how would someone else install the plugins? Currently, I use the include ability of Ant's build.xml and Maven's index.xml. To use Jetty as an example, I have a target_jetty.xml that I include in build.xml and a resources_jetty.xml that I include in index.xml. It seems to work, but I keep thinking there might be a more elegant way. When will Magic be moving over to dpml.net? Will Niclas still be involved in the development? Just curious about the future of Magic, as I like it. Thanks, Cameron On Thu, 23 Sep 2004 19:14:18 +0200, Stephen McConnell <[EMAIL PROTECTED]> wrote: > > 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] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]