Category Archives: Groovy

“Statically Typed Groovy”? Bwuh? I’m confused.

Hamlet d’Arcy just posted on Groovy getting a static mode, apparently called “Grumpy”. I’m really confused about why Groovy is bothering. First of all, we have to be clear that a statically typed Groovy is going to have to do away with a lot of functionality. After all, this is totally legitimate and well-defined Groovy [...]

Also posted in Programming Language Punditry | 2 Comments

Script: Write out ASM Code to Generate Java Class (Mark II)

Here’s an update to the Java class file to ASM script based on suggestions from Headius and Guillaume Laforge.   #!/usr/bin/env groovy   import org.objectweb.asm.util.ASMifierClassVisitor as V   @GrabResolver(name=’ow2.org’, root=’http://maven.ow2.org/maven2/’) @Grab(group=’asm’, module=’asm-all’, version=’[3.3,)’) private class JustHereForGrab {}   V.main(this.args) No need to muck with your grapeConfig.xml file with this script.

Posted in Groovy | Leave a comment

Script: Write out ASM Code to generate Java class

Edit: Updated version of the script here. Here’s a nifty little Groovy script to write out the ASM code to generate a given Java class. #!/usr/bin/env groovy   import org.objectweb.asm.util.ASMifierClassVisitor as V import org.objectweb.asm.ClassReader as R   @Grab(group=’asm’, module=’asm-all’, version=’[3.3,)') private class JustHereForGrab {}   new R(new File(this.args[0]).newInputStream()).accept(new V(new PrintWriter(System.out)), 0) You will have to [...]

Also posted in Ashlar/Cornerstone | 2 Comments

log.debug { "$toStringMe only if necessary!" }

I’ve just updated the @WithLog AST transform for Groovy to defer evaluation of GStrings in logging messages.

Also posted in Open Source | Leave a comment

Oh, Gradle, You Made My Heart Skip a Beat

As I just mentioned, I’ve been working on some Gradle plugins. I’ve been using Gradle in my polyglot programming book, and there’s a stunt (namely, running Cucumber in a Java/Groovy/Scala build) that I’d like the user to be able to do without too much hassle. The easiest way is to say, “Hey, use this plugin [...]

Also posted in Open Source | 2 Comments
  • Categories