tlberglund/groovy-liquibase — pull request #32 by mbruner (2013-02-19 23:09:59+00:00)
Title: Added support for liquibase feature called 'parameters'

I. Liquibase resolver
Liquibase allows user to define parameters which might be used in changesets.

Assume you have properties file:
key1=val1
key2=val2

Then you are able to write this in script to load file:

property(file: 'file.properties')

Or set parameters explicitly:

property(name: 'key3', value: 'val3')

and then you are able to access these properties in this way:

createTable(tableName: '${key1}', ...)

II. Using parameters in Groovy
Also I added ability to use Liquibase parameters directly in Groovy as regular variables:

createTable(tableName: key1, ...)
createTable(tableName: "${key1}", ...)

This solution doesn't support property names containing dots like 'table.name' but this properties might be used with Liquibase resolver.

III. Type conversion
All parameters from file are read as strings.
I used ObjectUtil.setProperty from Liquibase core to convert string values to corresponding types.