Category Archives: Groovy

Announcing Gradle-Plugins

A lot of people know that I have contributed a lot of Grails plugin work, even if my take on contributing is somewhat controversial. Well, I’m continuing on with that approach of plugin contributions, but now for Gradle, the world’s most awesome build system. You can check out the plugins at http://github.com/RobertFischer/gradle-plugins/. Be sure to [...]

Also posted in Open Source | 2 Comments

“Holy Crap, That Worked!”: Running JRuby/Cucumber from Gradle

I’m working on some code for my book and I’m trying out Swinger, which is a Cucumber library for Swing. I wanted to integrate it into my build (which is Gradle), but was running into issues. The problem is that I was pulling JRuby-Embed from the central Maven repo, which meant that I could only [...]

Also posted in Ruby/JRuby | Leave a comment

null Sucks: A Case in Point

Take a look at this API: ClassNode#addProperty. Turns out that if you pass null into getterBlock and setterBlock, you get the default implementations. Maybe1. Normally passing null around blows up in unhelpful ways, but here null is a useful value. How is a programmer to know? I’m increasingly convinced that immutability2 and strong type systems [...]

Also posted in Programming Language Punditry | 1 Comment

The @WithLog Annotation and Groovy ASTTransforms

I’ve just released a @WithLog annotation to GitHub under RobertFischer/Groovy-WithLog. The goal of @WithLog is to reduce the boilerplate associated with using Log4J. Normally, using Log4J looks like this: import org.apache.log4j.Logger   class Foo { static log = Logger.getLogger(Foo) /* … */ } I’ve now said Logger three times and my class name twice. And [...]

Also posted in Classic, Open Source | 11 Comments

Groovy version of Neal Ford’s JRuby “Recorder”

In Neal Ford’s JavaOne 2009 “‘Design Patterns’ for Dynamic Languages” talk1, he presented a record/playback object as an example of a decorator. He did so in JRuby, which is probably a good call since JRuby is more slide-friendly than Groovy (more on this later), but in presenting the recorder he said something in passing about [...]

Also posted in JavaOne | 5 Comments
  • Categories