Re: Magic 1st Spell Demo: Unrecognized rooot element [system]
Stephen McConnell <[email protected]>
| Newsgroups | gmane.comp.jakarta.avalon.user |
|---|---|
| Message-ID | <[email protected]> |
Cameron Taggart wrote:
> Niclas Hedhman wrote:
>
>> Really cool! Magic, IMHO, is more promising for ASF and many
>> commercial projects/products, than Maven (v1 or v2 doesn't matter).
>> BUT, we will NEED user feedback. What works, what doesn't, what should
>> be added, and what should be left out.
>
>
>> OTOH, Magic (if I get to influence enough) will NOT be everything for
>> everyone. But here is the beauty, if you have very special needs, just
>> insert more Ant targets in the build.xml...
>
>
> The most useful par of Magic I see is dealing with the
> library/dependency hell. What is the best way to reference
> libraries/resources that are managed by Magic from within a build file?
> It would be nice if you could name the dependency tags and reference
> them as classpathref or filesets from within the Ant build. That would
> be handy for custom Ant tasks and when populating WAR files. What
> variables/classpaths/filesets does Magic define that are usable within
> an Ant build file?
>
> What is the best way to use a custom Ant task? Should it be wrapped in
> a plugin? What is the best way to add this Hibernate Ant task, for
> example:
>
> <target name="hbm2ddl" description="Generates database schema with
> hbm2ddl.">
> <taskdef name="hbm2ddl"
> classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask">
> <classpath refid="???"/>
> </taskdef>
> <hbm2ddl
> config="hibernate.cfg.xml"
> quiet="yes" text="yes" drop="no" delimiter=";"
> output="target/database-schema.sql"/>
> </target>
Just add a <resource> definition to your index for the hbm2ddl jar, then
you can use a property to access the repository location.
<x:property name="filepath" key="hbm2ddl" feature="path"/>
The property "filepath" now contains the location of the hbm2ddl jar
file and you can use this to construct a <classpath> - for example:
<classpath>
<pathelement path="${magic.cache}/${filepath}"/>
</classpath>
You can also use <x:path> but I need to get the docs in place on that
first of all. Basically you can use <x:path> to get a dependency chain
as a proper ant path object that you can reference using refid. The
following example get the build time path for the current project:
<x:path id="build.path" mode="BUILD"/>
Stephen.
> --
> Cameron Taggart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
|---------------------------------------|
| Magic by Merlin |
| Production by Avalon |
| |
| http://avalon.apache.org |
|---------------------------------------|