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
class Foo { | |
Bar bar | |
} | |
class Bar { | |
static belongsTo = Foo | |
static hasMany = [bazzes: Baz] | |
} | |
class Baz { |
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 pipeInput = new PipedInputStream() | |
def outputStreamMock = new BufferedOutputStream(new PipedOutputStream(pipeInput)) | |
writerMock = new StringWriter() | |
File.metaClass.withOutputStream = {Closure c -> | |
c.call(outputStreamMock) | |
} | |
File.metaClass.withWriter = {Closure c -> | |
c.call(writerMock) | |
} |
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
repositories { | |
mavenCentral() | |
} | |
apply plugin: 'maven' | |
apply plugin: 'groovy' | |
apply plugin: 'idea' | |
group = 'org.gradle.plugins' | |
version = "${currentVersion}" |
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
@TestFor(FooController) | |
@Mock(FooFilters) | |
class FooSpec extends Specification { | |
FooService fooServiceMock | |
def "testing a filter"() { | |
given: | |
defineBeans { | |
fooService(MethodInvokingFactoryBean) { |
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.grails.gradle.plugin.GrailsTask | |
apply plugin: 'grails' | |
grails { | |
grailsVersion '2.2.1' | |
} | |
buildscript { | |
repositories { |
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
find . -name "Service*.json" | awk '{orig=$1;mod=$1;sub(/Service/,"",mod);sub(/.json/,"Service.json");print("git mv "orig" "mod)}' | /bin/sh |
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
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0) | |
grails.project.class.dir = "target/classes" | |
grails.project.test.class.dir = "target/test-classes" | |
grails.project.test.reports.dir = "target/test-reports" | |
grails.project.work.dir = "target/work" | |
grails.project.target.level = 1.6 | |
grails.project.source.level = 1.6 | |
//grails.project.war.file = "target/${appName}-${appVersion}.war" | |
forkConfig = [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256] |
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
csslint: { | |
options: { | |
formatters: [ | |
{id: 'lint-xml', dest: 'build/reports/csslint/csslint.xml'} | |
] | |
}, | |
strict: { | |
options: { | |
// IDs until re-use needed. Re-factor scaredy cats! | |
ids: false, |
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
apply plugin: 'groovy' | |
apply plugin: 'shadow' | |
buildscript { | |
repositories { | |
maven { | |
name 'Shadow' | |
url 'http://dl.bintray.com/content/johnrengelman/gradle-plugins' | |
} | |
} |
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
File pluginZip = project.file("grails-${project.name}-${version}.zip") | |
assemble.outputs.file pluginZip | |
project.components.add(new JavaLibrary( | |
new org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact( | |
project.name, | |
'zip', | |
'zip', | |
'', | |
new Date(pluginZip.lastModified()), |
OlderNewer