Buildr extension to execute the XJC binding compiler. WARNING: Integrated into buildr as of version 1.4.5
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
CHANGELOG
LICENSE
NOTICE
README.rdoc
Rakefile
buildr-jaxb-xjc.gemspec

README.rdoc

Warning

The extension has been integrated into buildr 1.4.5 and will be deprecated once the 1.4.5 version of buildr is released.

JAXB XJC builder extension

This extension provides the ability to invoke jaxb xjc binding compiler. A typical project that uses the extension may look something like;

require 'buildr_jaxb_xjc'

define "foo" do
  project.version = "1.0.0"
  compile.from compile_jaxb(_('src/schemas/wildfire-1.3.xsd'),
                            "-quiet",
                            :package => "org.foo.api")
  package :jar
end

The method compile_jaxb accepts either an array of files or a single file as the first parameter. It then accepts 0 or more arguments that are passed to the underlying XJC compiler. The arguments are documented at jaxb.dev.java.net/nonav/2.2.1/docs/xjc.html on the jaxb site. If the last argument is an options hash then the extension handles these specially. The supported options include:

  • :directory: The directory to which source is generated. Defaults to _(:target, :generated, :jaxb)

  • :keep_content: By default the generated directory will be deleted. If true is specified for this parameter the directory will not be deleted.

  • :package: The package in which the source is generated.

Installation

The extension is packaged as a gem named “buildr-jaxb-xjc”, consult the ruby gems installation steps but typically it is either

sudo gem install buildr-jaxb-xjc

for MRI ruby or

jgem install buildr-jaxb-xjc

for jruby.

The user then needs to add the following require into the build file:

require 'buildr_jaxb_xjc'