Mitch Pronschinske is a Senior Content Analyst at DZone. That means he writes and searches for the finest developer content in the land so that you don't have to. He often eats peanut butter and bananas, likes to make his own ringtones, enjoys card and board games, and is married to an underwear model. Mitch is a DZone Zone Leader and has posted 2573 posts at DZone. You can read more from them at their website. View Full User Profile

Get Your Hands on Griffon 0.9!

07.09.2010
| 7397 views |
  • submit to reddit

An early snapshot of Griffon 0.9 went live today and is available for your downloading pleasure. This will be the fifth major release of the Grails-like application framework for building desktop apps in Groovy.  Some exciting new features include packaging enhancements, infrastructure updates, application archetypes, improved testing, and command line updates.

Infrastructure

The last version of Griffon was numbered 0.3.1, but the major advancements in this next release merited a larger leap in version number.  Griffon 0.9 will upgrade its infrastructure to support Groovy 1.7.3, JUnit 4, and synchronize its codebase with Grails 1.3.2.  The 0.9 infrastructure allows the configuration of secure plugin repositories and there is a new file available that allows you to configure different aspects of the Griffon build including output paths and servers used for resolution of plugins.  Also, you'll find that the invocation order of build event handlers now honors the dependency order of the plugin that provides them.

Command Line

Two of the new command line features are inspired by Gradle.  The first is a common expansion ability which allows a command target to be expanded if you write in shortened notation using camel case.  This ought to save you plenty of keystrokes.  The second is a command wrapper (griffonw) that downloads, installs and runs a fully working Griffon distribution.  Another new features is an algorithm that kicks in if a command target is not recognized, even if the previous command expansion feature did not resolve to a known script.  This prevents you from accidentally invoking the griffon command with the wrong target.

Application Archetypes

Application Archetypes provide a solution for artifact templates that could not configure how an application is created.  These archetypes provide a hook into the application process by :

    •    Providing new versions of existing templates, like Model, Controller, etc.
    •    Creating new directories and files
    •    Installing a preset of plugins

These archetypes were inspired by Maven.  Here's how the default archetype descriptor (application.groovy) looks:
import griffon.util.Metadata

includeTargets << griffonScript("_GriffonPlugins")
includeTargets << griffonScript("_GriffonInit")
includeTargets << griffonScript("CreateMvc" )

target(createApplicationProject: 'Creates a new application project') {
createProjectWithDefaults()
createMVC()

// to install plugins do the following
// Metadata md = Metadata.getInstance("${basedir}/application.properties")
// installPluginExternal md, pluginName, pluginVersion
//
// pluginVersion is optional
}
setDefaultTarget(createApplicationProject)

Testing Upgrades

Griffon 0.9 tests can be run using the same phase:type mechanism found in Grails 1.3.2.  Griffon has three phases (unit, integration, and other) and two default types (unit and integration).  There will also be four other direct ports of Grails plugins for Griffon: Code-Coverage, Clover, CodeNarc, and GMetrics.

Packaging

Plugins have gotten some major upgrades in Griffon 0.9.  During plugin packaging, new jars can be generated that contain groovydocs generated for all sources, compiled test sources, and more.  There's also a new installer plugin that provides extra installer/launcher targets such as izpack, rpm, deb, mac, and windows.
                    
Andres Almiray, the founding member and project lead of the Griffon framework, has written five wonderful blogs on these five different aspects of the 0.9 release.  Check them out for the finer details.