Posts Tagged ‘Maven’
Open Source Drop: GitHub as a Maven Repo for Gradle, a JSON parser library and client, and JavaCC Plugin for Gradle April 23, 2012 | 03:19 pm

This is an announcement of a bunch of open source code that I’ve just released.

Using GitHub as a Maven Repository for Gradle

If you’re using Gradle for your JVM builds (and you should be) and GitHub for your open source project infrastructure (and you should be), then you might be pleasantly surprised to know that you can use GitHub as a Maven repository, which means that your library can be deployed to and served from GitHub’s own cloud infrastructure.

Your clients add this line to their Gradle build scripts:

apply from:"http://smokejumperit.com/github-libs.gradle"

And at that point, they can draw from anything deployed on GitHub. Good times!

For more information (including the five lines of code necessary for you to deploy to GitHub), see the README for the RobertFischer/gradle-github-dev project.

JSON Parser Library

A long while back, I was pissed off at the available JSON parsing libraries, so I wrote my own JavaCC-drived JSON parser library. It supports a fair bit of the broken JSON that is out in the wild, and is screaming fast. For more information, see the README for the RobertFischer/json-parser project.

JSON Client for the JVM: Resty

I’ve been playing around with a bunch of different JSON clients for interacting with a REST service (GitHub’s API v3) on the JVM, and I didn’t really like any of them. All of them felt WAAAAAAAAAAAY too Java-y, and I was looking for something much simpler. RESTClient for Groovy was nice, but I had trouble debugging the errors going to and from the server. After much searching, the best I found was beders’s Resty library, but it had a problem in that it couldn’t parse JSON arrays at the top level. So I forked it.

You can check out my version of Resty, which uses my more fault-tolerant and faster JavaCC JSON parser (see above) and can parse top-level arrays. There’s also substantially improved error handling, and it’s now built using Gradle instead of Maven because XML’s pointy brackets make my eyes bleed.

JavaCC/JJTree Compiler Plugin for Gradle

Finally, I’ve updated my JavaCC/JJTree compiler plugin for Gradle. This also involved updating the compiler-base plugin. Both were overdue for an update to support Gradle 1.0, and updating them was really a joy, since it meant ripping out a lot of bad code and replacing it with newfangled Gradle API calls.