Last active
December 10, 2015 00:48
-
-
Save halfbaked/4353649 to your computer and use it in GitHub Desktop.
setting the location of database migration changelogs to be in a Grails plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.codehaus.groovy.grails.plugins.PluginManagerHolder | |
... | |
def doWithConfig = { config -> | |
// Here we need to tell the database migrations plugin the change log is in the s5-core plugin | |
try { | |
def pluginManager = PluginManagerHolder.pluginManager | |
def plugin = pluginManager.getGrailsPlugin('s5-core') | |
def pluginDir = org.codehaus.groovy.grails.plugins.GrailsPluginUtils.getPluginDirForName('s5-core')?.path | |
config.grails.plugin.databasemigration.changelogLocation = "$pluginDir/grails-app/migrations" | |
} catch (Exception e) { | |
println "Error in doWithConfig $e" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment