Child pages
  • How to integrate JRuby's Warbler into Builder
Skip to end of metadata
Go to start of metadata

After having used Apache Builder for a week and extracted our Warbler-code into a bonafide extension, I'm sharing it with the community under the fetching name Barbler.

Barbler integrates itself between the build and packaging stages of the Apache Builder lifecycle and makes calls into Warbler to automate WAR-file creation. Now Warbler does a really good job for packaging standalone Rails apps. Unfortunately I needed something more integrated into our application build process, that pulls in our Spring Framework-based Java code, Scala code, and Rails application and produces a single WAR-file containing all dependent libraries, Rails code, XML deployment descriptors and Java class files. Apache Builder does everything other than the Rails-packaging. Barbler steps to provide that missing step.

Create a barbler.rb file in your project folder, which also contains your buildfile and copy the following contents into it:

Add the folllowing line to the top of your buildfile:

You can then define your warble task using the following line

whereby the first parameter is a path string to where your Rails code is located. You may locate your code in src/main/rails in which case you'd use

The second parameter is the list of Warbler tasks that you'd like to have executed. See the Warbler documentation for more help, or check out the Warbler source code - it's very readable.

  • No labels