You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Kerry Wilson <KW...@picagroup.com> on 2010/02/16 19:44:19 UTC

xjc and Buildr

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?
**********************************************************************
Disclaimer: This electronic message may contain information that is Confidential or legally privileged. It is intended only for the use of the individual(s) and entity named in the message. If you are not an intended recipient of this message, please notify the sender immediately and delete the material from your computer. Do not deliver, distribute or copy this message and do not disclose its contents or take any action in reliance on the information it contains. 
**********************************************************************

Re: xjc and Buildr

Posted by Alex Boisvert <al...@gmail.com>.
On Tue, Feb 16, 2010 at 10:44 AM, Kerry Wilson <KW...@picagroup.com>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