forked from Wagmar/testing_with_spock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
187 lines (151 loc) · 4.01 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.1.9.RELEASE'
}
}
plugins {
id 'java'
id 'jacoco'
id 'groovy'
id "org.asciidoctor.convert" version "1.5.9.2"
id 'nebula.integtest' version '5.0.0'
id 'nebula.release' version '13.0.0'
id 'nebula.lint' version '9.3.4'
id 'org.sonarqube' version '2.6.2'
}
apply {
plugin 'org.springframework.boot'
plugin 'io.spring.dependency-management'
}
ext {
set('snippetsDir', file("build/generated-snippets"))
guavaVersion = '27.0.1-jre'
mybatisVersion = '3.4.6'
mybatisSpringBootVersion = '1.3.2'
slog4jVersion = '0.11.0'
spockFrameworkVersion = '1.2-groovy-2.5'
spockReportsVersion = '1.6.1'
}
ext['spring-restdocs.version'] = '2.0.4.RELEASE'
group = 'com.exemplo'
sourceCompatibility = '1.8'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
compileOnly {
extendsFrom annotationProcessor
}
}
dependencyManagement {
dependencies {
dependencySet(group: 'org.spockframework', version: spockFrameworkVersion) {
entry 'spock-core'
entry 'spock-spring'
}
}
}
repositories {
mavenCentral()
}
dependencies {
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor'
implementation ('org.springframework.boot:spring-boot-starter-actuator')
implementation ('org.springframework.boot:spring-boot-starter-web')
implementation ('org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.0')
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
compile(
[group: 'org.springframework', name: 'spring-jdbc'],
[group: 'org.mybatis', name: 'mybatis', version: mybatisVersion],
[group: 'org.mybatis.spring.boot', name: 'mybatis-spring-boot-starter', version: mybatisSpringBootVersion],
[group: 'org.slf4j', name: 'slf4j-api'],
[group: 'org.slog4j', name: 'slog4j', version: slog4jVersion],
[group: 'com.google.guava', name: 'guava', version: guavaVersion]
)
runtime(
[group: 'mysql', name: 'mysql-connector-java', version: '5.1.48'],
[group: 'org.springframework.boot', name: 'spring-boot-starter-undertow']
)
integTestRuntime(
[group: 'org.apache.derby', name: 'derby'],
)
compileOnly(
[group: 'org.projectlombok', name: 'lombok']
)
developmentOnly ('org.springframework.boot:spring-boot-devtools')
annotationProcessor ('org.projectlombok:lombok')
testImplementation ('org.springframework.boot:spring-boot-starter-test')
testImplementation ('org.springframework.restdocs:spring-restdocs-mockmvc')
testCompile(
[group: 'org.projectlombok', name: 'lombok'],
[group: 'org.spockframework', name: 'spock-core'],
[group: 'org.spockframework', name: 'spock-spring'],
)
testRuntime(
[group: 'com.athaydes', name: 'spock-reports', version: spockReportsVersion]
)
}
springBoot {
// to create META-INF/build-info.properties. Its contents are exported by /info
buildInfo()
}
//
tasks.withType(Test) {
jacoco {
destinationFile = file("$buildDir/jacoco/test.exec")
}
finalizedBy jacocoTestReport
}
check.dependsOn tasks.withType(Test)
jacocoTestReport {
reports {
xml.enabled true
}
}
test {
outputs.dir snippetsDir
}
asciidoctor {
inputs.dir snippetsDir
dependsOn test
dependsOn integrationTest
// attributes revnumber : version.toString()
setAttributes([username : 'teste', revnumber : version.toString()])
}
gradleLint {
alwaysRun = false
rules += ['duplicate-dependency-class']
}
tasks.withType(Test) {
jvmArgs '-noverify', '-XX:TieredStopAtLevel=1',
'-Duser.timezone=America/Sao_Paulo',
'-Dio.netty.leakDetectionLevel=ADVANCED'
jacoco {
destinationFile = file("$buildDir/jacoco/test.exec")
}
finalizedBy jacocoTestReport
}
check.dependsOn tasks.withType(Test)
jacocoTestReport {
reports {
xml.enabled true
}
}
bootJar {
dependsOn asciidoctor
processResources {
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
}
sonarqube {
properties {
property 'sonar.projectName', "$name"
property 'sonar.projectKey', "$group:apresentacao"
}
}