diff options
author | 2021-11-17 03:06:39 +0100 | |
---|---|---|
committer | 2021-11-17 03:06:39 +0100 | |
commit | 720b9e2fb0968905e5a80f6099eab37554a6af58 (patch) | |
tree | b471f4da129efbfa730830a70e0107de852833d7 /buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle | |
parent | build: use version catalogs (diff) | |
download | refinery-720b9e2fb0968905e5a80f6099eab37554a6af58.tar.gz refinery-720b9e2fb0968905e5a80f6099eab37554a6af58.tar.zst refinery-720b9e2fb0968905e5a80f6099eab37554a6af58.zip |
build: move scripts into script plugins
Script plugins allow applying other plugins from plugins { } blocks,
which simplifies the build script.
Diffstat (limited to 'buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle')
-rw-r--r-- | buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle b/buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle new file mode 100644 index 00000000..d62207b7 --- /dev/null +++ b/buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle | |||
@@ -0,0 +1,33 @@ | |||
1 | plugins { | ||
2 | id 'jacoco' | ||
3 | id 'tools.refinery.java-conventions' | ||
4 | } | ||
5 | |||
6 | dependencies { | ||
7 | testImplementation libs.hamcrest | ||
8 | testImplementation libs.junit.api | ||
9 | testRuntimeOnly libs.junit.engine | ||
10 | testImplementation libs.junit.params | ||
11 | testImplementation libs.mockito.core | ||
12 | testImplementation libs.mockito.junit | ||
13 | } | ||
14 | |||
15 | def jacocoTestReport = tasks.named('jacocoTestReport') | ||
16 | jacocoTestReport.configure { | ||
17 | dependsOn test | ||
18 | reports { | ||
19 | xml.required = true | ||
20 | } | ||
21 | } | ||
22 | |||
23 | tasks.named('test') { | ||
24 | useJUnitPlatform { | ||
25 | excludeTags 'slow' | ||
26 | } | ||
27 | finalizedBy jacocoTestReport | ||
28 | } | ||
29 | |||
30 | tasks.register('slowTest', Test) { | ||
31 | useJUnitPlatform() | ||
32 | finalizedBy jacocoTestReport | ||
33 | } | ||