@@ -18,7 +18,7 @@ plugins {
18
18
checkstyle
19
19
jacoco
20
20
id(" com.rameshkp.openapi-merger-gradle-plugin" ) version " 1.0.4"
21
- id (" org.eclipse.dataspaceconnector.dependency-rules" ) apply (false )
21
+ id(" org.eclipse.dataspaceconnector.dependency-rules" ) apply (false )
22
22
id(" com.autonomousapps.dependency-analysis" ) version " 1.0.0-rc05" apply (false )
23
23
}
24
24
@@ -189,29 +189,53 @@ allprojects {
189
189
showStackTraces = true
190
190
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat .FULL
191
191
}
192
+
193
+ // this is the kotlin equivalent of a Groovy's "afterSuite" Closure to
194
+ // print a quick test summary.
195
+ // inspirations taken from https://stackoverflow.com/a/36130467/7079724 and
196
+ // https://github.com/gradle/kotlin-dsl-samples/issues/836#issuecomment-384206237
197
+ addTestListener(object : TestListener {
198
+ override fun beforeSuite (suite : TestDescriptor ) {}
199
+ override fun beforeTest (testDescriptor : TestDescriptor ) {}
200
+ override fun afterTest (testDescriptor : TestDescriptor , result : TestResult ) {}
201
+ override fun afterSuite (suite : TestDescriptor , result : TestResult ) {
202
+ if (suite.parent == null ) { // will match the outermost suite
203
+ val output =
204
+ " Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
205
+ val startItem = " | " ;
206
+ val endItem = " |" ;
207
+ val repeatLength = startItem.length + output.length + endItem.length
208
+ println (
209
+ ' \n ' + (" -" .repeat(repeatLength)) + " \n " + startItem + output + endItem + " \n " + (" -" .repeat(
210
+ repeatLength
211
+ ))
212
+ )
213
+ }
214
+ }
215
+ })
192
216
}
217
+ }
193
218
194
- tasks.withType<Checkstyle > {
195
- reports {
196
- // lets not generate any reports because that is done from within the Github Actions workflow
197
- html.required.set(false )
198
- xml.required.set(false )
199
- }
219
+ tasks.withType<Checkstyle > {
220
+ reports {
221
+ // lets not generate any reports because that is done from within the Github Actions workflow
222
+ html.required.set(false )
223
+ xml.required.set(false )
200
224
}
225
+ }
201
226
202
- tasks.jar {
203
- metaInf {
204
- from(" ${rootProject.projectDir.path} /LICENSE" )
205
- from(" ${rootProject.projectDir.path} /NOTICE.md" )
206
- }
227
+ tasks.jar {
228
+ metaInf {
229
+ from(" ${rootProject.projectDir.path} /LICENSE" )
230
+ from(" ${rootProject.projectDir.path} /NOTICE.md" )
207
231
}
232
+ }
208
233
209
- // Generate XML reports for Codecov
210
- if (System .getenv(" JACOCO" ) == " true" ) {
211
- tasks.jacocoTestReport {
212
- reports {
213
- xml.required.set(true )
214
- }
234
+ // Generate XML reports for Codecov
235
+ if (System .getenv(" JACOCO" ) == " true" ) {
236
+ tasks.jacocoTestReport {
237
+ reports {
238
+ xml.required.set(true )
215
239
}
216
240
}
217
241
}
@@ -247,13 +271,13 @@ if (project.hasProperty("dependency.analysis")) {
247
271
}
248
272
apply (plugin = " com.autonomousapps.dependency-analysis" )
249
273
configure< com.autonomousapps.DependencyAnalysisExtension > {
250
- // See https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin
274
+ // See https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin
251
275
issues {
252
276
all { // all projects
253
277
onAny {
254
278
severity(project.property(" dependency.analysis" ).toString())
255
279
exclude(
256
- // dependencies declared at the root level for all modules
280
+ // dependencies declared at the root level for all modules
257
281
" org.jetbrains:annotations" ,
258
282
" com.fasterxml.jackson.datatype:jackson-datatype-jsr310" ,
259
283
" com.fasterxml.jackson.core:jackson-core" ,
@@ -263,7 +287,7 @@ if (project.hasProperty("dependency.analysis")) {
263
287
}
264
288
onUnusedDependencies {
265
289
exclude(
266
- // dependencies declared at the root level for all modules
290
+ // dependencies declared at the root level for all modules
267
291
" com.github.javafaker:javafaker" ,
268
292
" org.assertj:assertj-core" ,
269
293
" org.junit.jupiter:junit-jupiter-api" ,
@@ -273,7 +297,7 @@ if (project.hasProperty("dependency.analysis")) {
273
297
}
274
298
onIncorrectConfiguration {
275
299
exclude(
276
- // some common dependencies are intentionally exported by core:base for simplicity
300
+ // some common dependencies are intentionally exported by core:base for simplicity
277
301
" com.squareup.okhttp3:okhttp" ,
278
302
" net.jodah:failsafe" ,
279
303
)
@@ -286,7 +310,7 @@ if (project.hasProperty("dependency.analysis")) {
286
310
abi {
287
311
exclusions {
288
312
excludeAnnotations(
289
- " io\\ .opentelemetry\\ .extension\\ .annotations\\ .WithSpan" ,
313
+ " io\\ .opentelemetry\\ .extension\\ .annotations\\ .WithSpan" ,
290
314
)
291
315
}
292
316
}
0 commit comments