/
DropwizardGrailsPlugin.groovy
50 lines (45 loc) · 1.61 KB
/
DropwizardGrailsPlugin.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import grails.plugin.dropwizard.DropwizardHolder
import grails.plugin.dropwizard.artifact.DropwizardHealthCheckArtefactHandler
import grails.plugin.dropwizard.artifact.DropwizardResourceArtefactHandler
import grails.plugin.dropwizard.artifact.DropwizardTaskArtefactHandler
class DropwizardGrailsPlugin {
String version = '0.1'
String grailsVersion = '2.0 > *'
String author = 'Burt Beckwith'
String authorEmail = 'beckwithb@vmware.com'
String title = 'Dropwizard Plugin'
String description = 'Adds support for Dropwizard'
String documentation = 'http://burtbeckwith.github.com/grails-dropwizard/'
List pluginExcludes = [
'docs/**',
'src/docs/**'
]
List artefacts = [DropwizardHealthCheckArtefactHandler, DropwizardResourceArtefactHandler, DropwizardTaskArtefactHandler]
List watchedResources = [
'file:./grails-app/dropwizard/**/*HealthCheck.groovy',
'file:./grails-app/dropwizard/**/*DropwizardResource.groovy',
'file:./grails-app/dropwizard/**/*DropwizardTask.groovy']
String license = 'APACHE'
def issueManagement = [system: 'Github', url: 'https://github.com/burtbeckwith/grails-dropwizard/issues']
def scm = [url: 'https://github.com/burtbeckwith/grails-dropwizard']
def doWithSpring = {
// fields will be set at startup
dropwizard(DropwizardHolder) { bean ->
bean.factoryMethod = 'getInstance'
}
}
def onChange = { event ->
if (application.isHealthCheckClass(event.source)) {
// TODO
}
else if (application.isDropwizardResourceClass(event.source)) {
// TODO
}
else if (application.isDropwizardTaskClass(event.source)) {
// TODO
}
}
def onConfigChange = { event ->
// TODO
}
}