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 data = '''<?xml version="1.0"?> | |
<catalog> | |
<book id="bk101"> | |
<author>Gambardella, Matthew</author> | |
<title>XML Developer's Guide</title> | |
<genre>Computer</genre> | |
<price>44.95</price> | |
<publish_date>2000-10-01</publish_date> | |
</book> | |
<book id="bk102"> |
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 xmlToFlatFile(xml, tag, mapping) { | |
def flatFile = new StringBuffer() | |
xml[tag].each { row -> | |
mapping.each { col -> | |
col.closure.delegate = [(tag): row] | |
def result = col.closure() ?: '' | |
flatFile << result | |
.trim() | |
.padRight(col.length) | |
.substring(0, col.length) |
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 MyService { | |
static expose = ['jmx'] | |
static jmxmethods = ['getTimeout', 'setTimeout'] | |
static jmxexpose = ['excludeMethods': | |
MyService.metaClass.methods*.name.findAll{ | |
!jmxmethods.contains(it) | |
}.join(',')] | |
int timeout |
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
includeTargets << grailsScript("_GrailsClean") | |
includeTargets << grailsScript("RefreshDependencies") | |
includeTargets << grailsScript("TestApp") | |
target(cleanTestApp: "Clean, refresh dependencies, then test app") { | |
depends(cleanAll, refreshDependencies, 'default') | |
} | |
setDefaultTarget("cleanTestApp") |
NewerOlder