On Tue, Feb 16, 2010 at 10:44 AM, Kerry Wilson <[email protected]>wrote:
> I need to be able to generate Classes using xjc. This is currently being
> done using ant:
>
> <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
> <classpath>
> <fileset dir="${common.devlib.dir}" includes="*.jar"/>
> </classpath>
> </taskdef>
> <target name="generate_jaxb_classes">
> <mkdir dir="${gen.src.dir}"/>
> <xjc schema="${jaxb.schema}" destDir="${gen.src.dir}"
> package="${jaxb.package}"/>
> </target>
>
> Is there a way to do the equivalent in Buildr? Using ant task or (even
> better) w/o using ant task?
>
It's pretty easy to use Ant tasks from Buildr. Buildr embeds
Antwrap<http://antwrap.rubyforge.org/>and the API doc is here:
http://buildr.apache.org/rdoc/classes/Buildr/Ant.html
You'll find a few examples under
/usr/lib/ruby/gems/1.8/gems/buildr-1.3.5/addon/buildr (or wherever Buildr is
installed on your system). There are other plugins/extensions floating
around and blog posts, e.g.
http://zeusville.wordpress.com/2010/02/13/buildr-ant-maven/)) that should
give you a pretty good idea how to get there.
Ask questions if you need help.
alex