O'Reilly logo

JRuby Cookbook by Henry Liu, Justin Edelson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Build Tools

Introduction

Just about every software project, regardless of language or scope, needs to be built in some way. The build process can include steps including compiling code, running automated tests, file processing, packaging, and deployment, among others. Because there is significant commonality among build processes, a variety of specialized build systems are available. These systems allow you to describe your build process as a series of interdependent, reusable tasks. Ant, for example, allows you to replace this:

$ javac *.java
$ jar –cf my.jar *.class

With this:

$ ant jar

Or even (if jar is the default target):

$ ant

This chapter discusses techniques for building Java-based projects. In this context, Ruby can be used as the core of the build process or to enhance an existing build process. There are two major build systems used for Java projects: Ant and Maven. Both of these are projects of the Apache Software Foundation and both have extension mechanisms that support JRuby. This is the focus of the first few recipes. The later recipes describe two different Ruby-based build systems designed for Java projects: Raven and Buildr. All four of these build systems have merit: which to use for a particular project is largely a matter of preference. Raven and Buildr are significantly newer than Ant and Maven and, as a result, the communities around them are smaller.

The chapter ends with two recipes about the Hudson continuous integration server. The first of these ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required