Building and testing with Gradle

Written by Tim Berglund and Matthew McCullogh published by O’Reilly, ISBN: 9781449304638

The only book out there on Gradle, and it is relatively new published July 2011. At 110 pages it is rather short, and doesn’t cover everything about Gradle - it’s not a ‘Complete guide to Gradle’, but the 6 chapters cover the basics in the obvious ways:

  1. Hello, Gradle!
  2. Gradle Tasks
  3. Ant and Gradle
  4. Maven and Gradle
  5. Testing with Gradle
  6. Multiproject Builds

The book does provide pointers for migrating from e.g. Maven to Gradle. As I’m not intimately familiar with neither Maven nor Gradle, I can’t really say if it is sufficient to jump from Ant directly into Gradle, or if a quick pit-stop in the Maven (3?) camp is beneficial.

There are a few kind of typos in the book, e.g. Example 1-5 the src directory seems to be a subdirectory of the build.gradle file, this is fixed in Example 1-6 though.

There’s also a minor issue with the doFirst() method - I’d suggest saying that this would prepend or prefix the closure to the existing block as opposed to saying appending to the beginning.

The book is more concise and better organized than the Gradle user guide which seems to do a halfbaked description, then referring to a later chapter.

Running some modified examples from the book - not from the github repository - I experienced a rather detrimental blow up when applying the plugins for Scala and Groovy. The compiler dependencies need to be added to the build file.

Being the only book on the subject it’s sad that it’s not a Complete Guide, but it does fulfill what the title promises, it’s just not enough. An okay read though.

One Response to “Building and testing with Gradle”

  1. Tim Berglund siger:

    Your Serverdudeness,

    Thanks for buying and reading the book. As for your conclusion that it’s just not enough, I am going to have to agree with you! That’s why Matthew and I are hard at work on the sequel, tentatively called Programming Gradle. There’s a lot more you’ll have to know to be a Gradle power user that just couldn’t fit into the first book, given the desire to keep it small. (This lets us favor electronic distribution—which the community is already doing—and lets us get a book out to the community faster, rather than making everyone wait for us to write a longer book.)

    I can’t thank you enough for publishing a review. Keep using Gradle, and email the user list or contact us if you have questions.

    Warmly,
    Tim