Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The Groovy development team is pleased to announce the joint release of Groovy 1.7.7 and Groovy 1.8-beta-4, the latest releases of the popular dynamic language for the JVM.

Groovy 1.7.7 is a maintenance release of our official stable 1.7.x branch, whereas 1.8-beta-4 is the last beta version before the release candidates of the upcoming major version of Groovy.

The key highlights of the latest beta are:

  • our ongoing performance improvement work on primitive integer calculations,
  • the bundling of GPars in the libraries of the binary distribution,
  • and built-in JSON support with a JSON slurper and a JSON parser

If you wish to learn more about the JSON support, you can have a look at the JSON Groovy Extension Proposal and the unit tests for the slurper and the builder.

Here's an example for the JSON slurper, fetching tweets from Twitter about the #groovy hashtag:

Code Block
import groovy.json.*

def slurper = new JsonSlurper()
def url = "http://search.twitter.com/search.json?q=%23groovy"
def content = new URL(url).getText("UTF-8")
def root = slurper.parseText(content)
root.results.each { println it.text }

And another example showing how you can create JSON payloads with the JSON builder:

Code Block
import groovy.json.*

def json = new JsonBuilder()

json.response {
    status "ok"
    userTier "free"
    total 2413
    startIndex 1
    pageSize 10
    currentPage 1
    pages 242
    orderBy "newest"
    results([
        id: "world/video/2011/jan/19/tunisia-demonstrators-democracy-video",
        sectionId: "world",
        sectionName: "World news",
        webPublicationDate: "2011-01-19T15:12:46Z",
        webTitle: "Tunisian demonstrators demand new democracy - video",
        webUrl: "http://www.guardian.co.uk/world/video/2011/jan/19/tunisia-demonstrators-democracy-video",
        apiUrl: "http://content.guardianapis.com/world/video/2011/jan/19/tunisia-demonstrators-democracy-video"
    ],
    [
        id: "world/gallery/2011/jan/19/tunisia-protests-pictures",
        sectionId: "world",
        sectionName: "World news",
        webPublicationDate: "2011-01-19T15:01:09Z",
        webTitle: "Tunisia protests continue - in pictures ",
        webUrl: "http://www.guardian.co.uk/world/gallery/2011/jan/19/tunisia-protests-pictures",
        apiUrl: "http://content.guardianapis.com/world/gallery/2011/jan/19/tunisia-protests-pictures"
    ])
}

You can download and read about the JIRA release notes here:

Groovy 1.7.7

Groovy 1.8-beta-4

You may wish to have a look at the recent features introduced in previous betas by reading the following release notes:

  • Groovy 1.7.6 and 1.8-beta-3 : new AST transformations, closure memoization and trampolining, etc.
  • Groovy 1.7.5 and 1.8-beta-2 : closure composition, new Domain-Specific Language syntax, etc.
  • Groovy 1.7.4 and 1.8-beta-1 : new AST transformations, annotation closure parameters, etc.
    We'd be glad of you could test the Groovy 1.8 beta to give us as much feedback as you can on this release, before it becomes the new official stable branch of Groovy. Thanks a lot for your help making the 1.8 release a success and for your invaluable feedback. We'd love that everybody try the latest beta in their respective applications, so we can find any regression or potential issue that may arise.

Thanks a lot to all involved in this pair of releases, and for the support of our friendly community!