Skip to content

Instantly share code, notes, and snippets.

@hartsock
Created August 19, 2010 13:27
Show Gist options
  • Save hartsock/537873 to your computer and use it in GitHub Desktop.
Save hartsock/537873 to your computer and use it in GitHub Desktop.
Installs plugin zip files found in a Grails apps' base directory.
/**
* install in your application's 'scripts' directory.
* <p/>
* invoke: $ grails install-local-plugins
* <p/>
* @author Shawn Hartsock <hartsock@acm.org>
*/
includeTargets << grailsScript("Init")
includeTargets << grailsScript("_PluginDependencies")
target(installLocalPlugins: "The description of the script goes here!") {
def plugins = []
new File( Ant.project.properties.basedir ).listFiles().each { File f ->
if(f.isFile() && f.name.startsWith("grails") && f.name.endsWith(".zip")) {
plugins.add(f)
}
}
println "plugins found: ${plugins}"
def isInt = isInteractive
plugins.each { plugin ->
println "installing: ${plugin}"
isInteractive = false
doInstallPluginZip(plugin)
println "finished with: ${plugin}"
}
isInteractive = isInt
println "local plugins were installed."
}
setDefaultTarget(installLocalPlugins)
@hartsock
Copy link
Author

This one is the sound of me giving up on doing things the right way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment