generated from cratekube/dropwizard-groovy-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
92 lines (79 loc) · 2.4 KB
/
build.gradle
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
plugins {
id 'com.jfrog.bintray' version '1.8.4'
id 'com.jfrog.artifactory' version '4.14.1'
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'com.benjaminsproule.swagger' version '1.0.8'
id 'org.hidetake.swagger.generator' version '2.18.2'
id 'com.github.johnrengelman.shadow' version '5.1.0'
}
allprojects {
apply plugin: 'groovy'
version = System.env.APP_VERSION ?: version
}
apply from: 'gradle/config.gradle'
apply from: 'gradle/git.gradle'
apply from: 'gradle/maven.gradle'
apply from: 'gradle/bintray.gradle'
apply from: 'gradle/artifactory.gradle'
apply from: 'gradle/quality.gradle'
repositories {
mavenLocal()
jcenter()
}
dependencies {
implementation 'org.codehaus.groovy:groovy:3.0.1'
implementation "io.dropwizard:dropwizard-core:${dropwizardVersion}"
implementation "io.dropwizard:dropwizard-client:${dropwizardVersion}"
implementation 'com.smoketurner:dropwizard-swagger:2.0.0-1'
implementation 'ru.vyarus:dropwizard-guicey:5.0.0'
implementation 'org.valid4j:valid4j:0.5.0'
implementation 'org.hamcrest:hamcrest-all:1.3'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'de.spinscale.dropwizard:dropwizard-jobs-guice:3.0.0'
swaggerCodegen 'io.swagger:swagger-codegen-cli:2.4.12'
testImplementation 'cglib:cglib-nodep:3.2.6'
testImplementation "io.dropwizard:dropwizard-testing:${dropwizardVersion}"
testImplementation 'org.spockframework:spock-core:2.0-M2-groovy-3.0'
}
swaggerSources {
"${project.name}" {
inputFile = file("${project.buildDir}/swagger-ui/swagger.json")
code {
language = 'java'
configFile = file('swagger-config.json')
}
}
}
task buildClient(type: Copy) {
into "${rootDir}/${project.name}-client"
from "${buildDir}/swagger-code-${project.name}"
}
clean.doFirst {
delete "${rootDir}/${project.name}-client"
}
jar {
manifest {
attributes 'Main-Class': project.mainClass
}
}
shadowJar {
mergeServiceFiles()
}
swagger {
apiSource {
springmvc = false
expandSuperTypes = false
locations = [project.group]
schemes = ['http', 'https']
host = 'localhost:8080'
basePath = '/'
info {
title = "${project.name} swagger spec"
version = 'v1'
description = "swagger spec for the ${project.name}"
}
swaggerDirectory = "${project.buildDir}/swagger-ui"
}
}
resolveSwaggerTemplate.dependsOn generateSwaggerDocumentation
buildClient.dependsOn generateSwaggerCode