Overview

New Features

Buildtime

Dependencies

Griffon 0.9.5 upgrades the following dependencies

Groovy 1.8.6

Spring 3.1.0.RELEASE

Ant 1.8.2

Slf4j 1.6.4

Plugins and Archetypes

Perhaps the biggest change brought by this release is the full rework of=
the plugin system. Under the new rules it should be easier to create/build=
/install/upgrade/manage plugins. Archetypes too can be versioned and releas=
ed like plugins are. this should make it easier to locate and install arche=
types.

Artifact Repositories

Hosting your own plugins and archetypes just got easier. No more fumblin=
g around with SVN and HTTP, the only thing you need now is a writable direc=
tory in the filesystem for now. Griffon 0.9.5 delivers 3 types of artifact =
repositories: local, remote and legacy. A default local repository is alway=
s available to you; you may configure additional ones. Remote repositories =
are supported in this version but the code to publish them is not yet relea=
sed (keep an eye on https://github.com/griffon=
/griffon-artifact-portal though). Finally the legacy repository should =
ease up the transition to the new workflow.

Configuring a local repository is dead simple, as the following snippet =
shows

The repo definition may be placed under griffon-app/conf/BuildConfig.gro=
ovy or $USER_HOME/.griffon/settings.groovy

Classpath Resolution

The classpath used for build, compile, runtime and test should now be re=
solved at the last possible moment, instead of the earliest possible as it =
was before. Resolving the classpath eagerly caused a lot of trouble with ad=
dons.

Default Answer in=
Non Interactive Mode

Sometimes a command may require the user to specify a missing value. Whe=
n the build is run in interactive mode (the default mode) then it's just a =
matter of typing the value in the console. However, if the build is run in =
non-interactive mode then it's very likely it will fail.

For this reason, the Griffon build accepts the definition of a default a=
nswer if the griffon.noninteractive.default.answer key is specifie=
d, like this

=20

griffon -Dgriffon.noninteractive.default.answer=3Dy release-plu=
gin

=20

Be warned that this setting applies to every single input asked by a com=
mand.

Default Packaging Targets=
h3>

4 packaging targets get executed when the package command is called with=
no arguments. There's now the option to specify which ones, by defining a =
list of Strings for griffon.packaging, for example

=20

griffon.packaging =3D ['zip', 'jar']

=20

Now only those 2 targets will be executed whenever the package command i=
s called without arguments. You can specify additional targets if the Insta=
ller plugin is available.

Dependency Resolution

It's now possible to specify SNAPSHOT dependencies on plugins and JARs. =
Classifiers on dependencies will also be honored, both in condensed and ext=
ended format, that is

Interactive Shell

There's a new interactive shell based on Apache Karaf's console. This ne=
w tool can be invoked by calling griffonsh from the command line. =
This console should enable faster responses as the JVM is started only once=
; also dependencies are cached and environment settings are retained. This =
shell grants access to all standard griffon command plus a few ones specifi=
c to this new environment. There are some rough edges still so treat it car=
efully

Offline Mode

Dependency resolution can now work in offline mode. When engaged, no ext=
ernal repository will be queried for dependencies; all dependencies should =
be resolved against the current cache. Also, all artifact repositories are =
off limits, except those of type local. This mode can be enabled by specify=
ing griffon.offline.mode in either griffon-app/conf/Buil=
dConfig.groovy or $USER_HOME/.griffon/settings.groovy. =
This flag can also be set as a system property.

WindowManager and J=
InternalFrames

Speaking of Swing, the WindowManager is now capable of dealing with JInt=
ernalFrames as if they were windows. You can now show/hide/manage JInternal=
Frames in the same way as Windows.

Automatic Addon Discovery=
h3>

Addons will now be automatically discovered and registered by the runtim=
e. There's no longer a need to configure addons in plugin scripts (like _In=
stal.groovy) unless the addon requires non-standard configuration (which sh=
ould be the least of cases).

Additional MVC Grou=
p Configuration

It's now possible to supply a group with more configuration while each m=
ember is being initialized. Simply define a config member in the g=
roup's definition, for example

Disable the Event Bus

Sometimes you don't want controllers to be registered as application eve=
nt listeners because their code never handles an event. This results in per=
formance upgrades as controllers need not be notified. Both the application=
's event bus and custom event buses (classes annotated with @griffon.=
transform.EventPublisher) have a new method that control if the even=
t bus is enabled or not. Events posted while the event bus is disabled will=
be automatically discarded.

Skip Contro=
ller as Application Event Handler

Sometimes you don't want controllers to be registered as application eve=
nt listeners because their code never handles an event. This results in per=
formance upgrades as controllers need not be notified. This feature relies =
on the new config section available to MVC groups. Here's how =
this feature can be specified

Skip Firing MVC Lifecy=
cle Events

There are times when creating multiple MVC groups where there's no need =
to trigger MVC events for example, a custom MVCGroupManager can potentially=
disable the event router for a time, then enable it after the group has be=
en constructed. This feature relies on the new config section =
available to MVC groups. Here's how this feature can be specified

Skip Firing MVC New =
Instance Events

Applications will fire an event named NewInstance whenever =
an artifact gets instantiated, this results in 3 events per MVC group in th=
e typical case. This is great for letting other parts of the application kn=
ow that there's a new artifact instance that can be processed by dependency=
injection for example. But, the runtime also pays the penalty for notifyin=
g listeners that may not handle the event. Skipping these events may lead t=
o better performance. This feature relies on the new config se=
ction available to MVC groups. Here's how this feature can be specified

Applications, addons and artifacts have been retrofitted with this inter=
face; it's recommended that you use these facilities instead of querying a =
classloader. Also, there's a new AST transformation that grafts these metho=
ds to any class: griffon.transform.ResourcesAware.

Breaking Changes

Buildtime

The plugin system and classpath resolution have been completely overhaul=
ed. We don't expect any major breackages however we sure to upgrade to the =
latest versions of available plugins. If you're running a plugin that has n=
ot been upgraded to 0.9.5 and its causing you trouble then please let us kn=
ow asap and we'll fix it.

Runtime

Now that Swing support is provided outside of core every application mus=
t make sure to include it as a dependency. The upgrade command does this fo=
r you.

Threading Methods Renamed=
h3>

The names of the threading methods (execSync, execAsync, execOutside) ca=
n be confusing. they have been renamed to the following ones

The old method names are still available and have been marked as depreca=
ted. They will be removed when Griffon 1.0 is released.

Sample Applications

Griffon 0.9.4 ships with 5 sample applications of varying levels of comp=
lexity demonstrating various parts of the framework. In order of complexity=
they are:

File Viewer

File Viewer is a simple demonstration of creating new MVCGroups on the f=
ly.

Source: samples/FileViewer

To run the sample from source, change into the source directory and run =
griffon run-app from the command prompt.

GroovyEdit

GroovyEdit is an improved version of FileViewer that uses custom observa=
ble models.

Source: samples/GroovyEdit

To run the sample from source, change into the source directory and run =
griffon run-app from the command prompt.

Font Picker

Font Picker demonstrates form based data binding to adjust the sample re=
ndering of system fonts.

Source: samples/FontPicker

To run the sample from source, change into the source directory and run =
griffon run-app from the command prompt.

Greet

Greet, a full featured Griffon Application, is a Twitter client. It show=
s Joint Java/Groovy compilation, richer MVCGroup interactions, and network =
service based data delivery.

Source: samples/Greet

To run the sample from source, change into the source directory and run =
griffon run-webstart from the command prompt. Because Greet us=
es JNLP APIs for browser integration using run-app will preven=
t web links from working.

SwingPad

SwingPad, a full featured Griffon Application, is a scripting console fo=
r rendering Groovy SwingBuilder views.

Source: samples/SwingPad

To run the sample from source, change into the source directory and run =
griffon run-app from the command prompt.