Created
April 8, 2011 18:33
-
-
Save acreeger/910438 to your computer and use it in GitHub Desktop.
Code that you can add to your app's BuildConfig to enable you to specify in-place plugins outside of source controlled files
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
def buildConfigFile = new File("${userHome}/.grails/${appName}-buildConfig.groovy") | |
if (buildConfigFile.exists()) { | |
println "Processing external build config at $buildConfigFile" | |
def slurpedBuildConfig = new ConfigSlurper().parse(buildConfigFile.toURL()) | |
slurpedBuildConfig.grails.plugin.location.each { k, v -> | |
if (!new File(v).exists()) { | |
println "WARNING: Cannot load in-place plugin from ${v} as that directory does not exist." | |
} else { | |
println "Loading in-place plugin $k from $v" | |
grails.plugin.location."$k" = v | |
} | |
if (grailsSettings.projectPluginsDir?.exists()) { | |
grailsSettings.projectPluginsDir.eachDirMatch(~/${k}.*/) {dir -> | |
println "WARNING: Found a plugin directory at $dir that is a possible conflict and may prevent grails from using the in-place $k plugin." | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment