5.6.1 Metadata - Reference Documentation
Authors: Andres Almiray
Version: 1.2.0
5.6.1 Metadata
Access to the application's metadata file (application.properties
) is available by querying the griffon.util.Metadata
singleton. Here's a snippet of code that shows how to setup a welcome message that displays the application's name and version, along with its Griffon versionimport griffon.util.Metadatadef meta = Metadata.current application(title: "Some app", package: true) { gridLayout cols: 1, rows: 2 label "Hello, I'm ${meta['app.name']}-${meta['app.version']}" label "Built with Griffon ${meta['app.griffon.version']}" }
getApplicationName()
- same result asmeta['app.name']
getApplicationVersion()
- same result asmeta['app.version']
getApplicationToolkit()
- same result asmeta['app.toolkit']
getGriffonVersion()
- same result asmeta['app.griffon.version']
getGriffonStartDir()
- returns the value of'griffon.start.dir'
from the System propertiesgetGriffonWorkingDir()
- returns a File that points to'griffon.start.dir'
if the value is set and the file is writable, otherwise returns a File pointing to the current location if it is writable; if that fails then attempts to return a File pointing to'user.dir'
; if all fail it will return the location to a temporal file, typically'/tmp/${griffonAppName}'
.