Skip to content

Instantly share code, notes, and snippets.

View robfletcher's full-sized avatar

Rob Fletcher robfletcher

View GitHub Profile
@robfletcher
robfletcher / build.gradle
Created January 17, 2010 20:05
Example of using a Gradle multi-project build to test a Grails plugin and all its test-apps
allprojects {
task clean << { task ->
ant.exec(executable: "grails", dir: "$task.project.projectDir", failonerror: true) {
arg line: "clean"
}
}
}
task test << {
ant.exec(executable: "grails", dir: "$projectDir", failonerror: true) {
package com.energizedwork.grails.plugins.jodatime;
import grails.converters.JSON;
import org.codehaus.groovy.grails.web.converters.exceptions.ConverterException;
import org.codehaus.groovy.grails.web.converters.marshaller.ObjectMarshaller;
import org.codehaus.groovy.grails.web.json.JSONException;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_PluginDependencies")
target('default': "Prepares development environment") {
depends(installPlugins, installDependencies)
event("StatusFinal", ["Done"])
}
target(installPlugins: "Installs all plugins") {
depends(resolveDependencies)
@robfletcher
robfletcher / CheckPluginVersions.groovy
Created June 15, 2009 10:19
Grails script that checks the versions of plugins you have installed and notifies you when newer versions are available
import groovy.xml.dom.DOMCategory
includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsPlugins")
def getAvailablePluginVersions = {
def plugins = [:]
eachRepository {repo, url ->
use(DOMCategory) {
pluginsList.'plugin'.each {plugin ->