❯ Guillaume Laforge

Build

Just a handy command-line tool

When developing new projects on my laptop, I often run some commands over and over again. Regardless of how far you’ve gone with your CI/CD pipelines, running commands locally without resorting to becoming a bash ninja can be pretty easy with… just! just is a handy way to save and run project-specific commands It’s a command-line tool that lets you define some commands to run (called recipes), in the form of a Makefile-inspired syntax. Read more...

Gradle vs Maven and Gradle in Kotlin or Groovy

Once in a while, when talking about Gradle with developers, at conferences or within the Groovy community (but with the wider Java community as well), I hear questions about Gradle. In particular Gradle vs Maven, or whether developers adopt the Kotlin DSL for Gradle builds. In the past, I blogged several times about using BigQuery and the Github dataset to analyze open source projects hosted on Github, by running some SQL queries against that dataset. Read more...

Analyzing half a million Gradle build files

Gradle is becoming the build automation solution of choice among developers, in particular in the Java ecosystem. With the Github archive published as a Google BigQuery dataset, it’s possible to analyze those build files, and see if we can learn something interesting about them! This week, I was at the G3 Summit conference, and presented about this topic: I covered the Apache Groovy language, as per my previous article, but I expanded my queries to also look at Grails applications, and Gradle build files. Read more...

Creating a new project with Gradle

Since I started using Gradle for building my projects, as soon as I needed to create a brand new project from scratch, I wished that Gradle guided my hand and created the right directory structure and minimal Gradle build script. A bit less than two years ago, I was inspired by Dierk’s gist providing a basic build that provided two tasks, one for creating the directory layout, and the other one to create the Gradle wrapper. Read more...

Building your Groovy 2.0 projects with Maven

There are various options for building your Groovy projects: including Ant with the Groovyc Ant task, or with Gradle Groovy plugin. But today, I’d like to speak about Maven. You have actually two possible choices: GMaven or the Groovy Eclipse Maven plugin. GMaven GMaven 1.4 already allowed you to use Groovy 2.0 even before the final release of Groovy, although a new 1.5 version is about to be released soon, which should also include the option to use the “invoke dynamic” support which is currently missing for GMaven 1. Read more...

Handy Gradle startup script

Dierk published a gist on GitHub with a handy Gradle build script to help you bootstrap a Gradle-built project from scratch, without having to create the directory layout manually, or install the Gradle wrapper. This is pretty neat and should be integrated in Gradle to ease the creation of projects! I’ve updated the gist with a more recent version of Groovy and Gradle. And so that I never forget about this handy Gradle build script, I’m blogging about it and reproducing it here, to save me precious minutes finding it again the next time I need it! Read more...

Lots of Gradle news and activity

The Gradle project is moving quickly towards its final version and we hear more and more projects adopting or migrating to Gradle for their build and project automation. Gradle founder Hans Dokter pushed very interesting posts those past days: On our way to Gradle 1.0: where he explains the current features being worked on before being able to reach 1.0, with a strong focus on three key aspects: the new dependency cache, the daemon, and performance improvements. Read more...

AntBuilder: Imitation is the Best Form of Flattery

I’ve just come across a clone of Groovy’s AntBuilder. It’s being built with JRuby and allows you to write your build scripts in JRuby by reusing Ant’s tasks. That was a pleasure to see Ruby inspired by our concept of builders, and now, they also copy our own builders. I’d simply say that imitation is the best form of flattery. Kudos guys!

Maven Developer's Notebook

I’m glad I just received my Maven Developer’s Notebook, from O’Reilly. My friend Vincent Massol and Tim O’Brien co-authored this great book on Maven, a definitely needed reading for all those who want to learn more about Maven, or who wants to get started quickly. I had the chance of being one of the reviewers and it allowed me to learn quite a few tricks in the process, at the same time I was converting one of my projects at work to a “mavenized” build process and integrating it inside Luntbuild for continuous integration. Read more...

Maven scripting in Groovy

Recently, on Maven’s user list, someone wanted to be able to script Maven with Groovy, like it was already possible with BeanShell or Jython thanks to specific Jelly tags. But unfortunately, Maven didn’t provide that kind of support for Groovy. But there are good news on that front since Jeremy Rayner contributed a nice Groovy Ant task. That Ant task will be available in the upcoming Groovy release (jsr-02), so if you want to play with Maven and Groovy, you’ll have to build Groovy from sources in the meantime. Read more...