tlberglund/groovy-liquibase — pull request #24 by jclawson (2011-12-15 22:46:49+00:00)
Title: Dynamic custom changes, fixed reliance on deprecated method

GroovyLiquibaseChangeLogParser - Fixed usage of deprecated GroovyShell.parse method

Also, added a test example and supporting classes to implement dynamic augmentations to the DSL to support adding liquibase.change.custom.CustomSqlChange. This will allow people to add their own DSL changes that may be specific to their environment without having to fork the project. It took me a while to figure out how to get Groovy to do what I was looking for. If you know of a better way, feel free to change the code. The basic thing is I implemented ChangeSetDelegateMetaClass which extends ExpandoMetaClass and adds a MetaMethod inside to augment the class.

Please feel free to rename things, or make things better :-). Some code was written in Java first and then copied to groovy, so it may seem too Javaesque (*cough* CustomProgrammaticChangeWrapper *cough*).

I included the CustomProgrammaticChangeWrapper because some kind of wrapper is required to wrap liquibase.change.custom.CustomSqlChange since a CustomSqlChange is not a "Change". The wrapper liquibase provides requires some Class.forName logic and other things that only make sense if you are going from xml -> java. Since we are already in code it makes more sense to reimplement the wrapper so its simpler and more performant.