aboutsummaryrefslogtreecommitdiffstats
path: root/buildSrc
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-11-17 03:09:48 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-11-17 03:09:48 +0100
commit34ec8e86c6414a6b071ccd65fc0dad0d56d0f368 (patch)
tree3ebbe359988eb5740e7429d1ac5c6c35bc4bac8f /buildSrc
parentbuild: move scripts into script plugins (diff)
downloadrefinery-34ec8e86c6414a6b071ccd65fc0dad0d56d0f368.tar.gz
refinery-34ec8e86c6414a6b071ccd65fc0dad0d56d0f368.tar.zst
refinery-34ec8e86c6414a6b071ccd65fc0dad0d56d0f368.zip
build: merge java and junit conventions
All Java code should have tests, anyways.
Diffstat (limited to 'buildSrc')
-rw-r--r--buildSrc/src/main/groovy/tools.refinery.java-conventions.gradle30
-rw-r--r--buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle33
2 files changed, 30 insertions, 33 deletions
diff --git a/buildSrc/src/main/groovy/tools.refinery.java-conventions.gradle b/buildSrc/src/main/groovy/tools.refinery.java-conventions.gradle
index 6bea6e46..2712d391 100644
--- a/buildSrc/src/main/groovy/tools.refinery.java-conventions.gradle
+++ b/buildSrc/src/main/groovy/tools.refinery.java-conventions.gradle
@@ -1,5 +1,6 @@
1plugins { 1plugins {
2 id 'eclipse' 2 id 'eclipse'
3 id 'jacoco'
3} 4}
4 5
5repositories { 6repositories {
@@ -9,9 +10,38 @@ repositories {
9 } 10 }
10} 11}
11 12
13dependencies {
14 testImplementation libs.hamcrest
15 testImplementation libs.junit.api
16 testRuntimeOnly libs.junit.engine
17 testImplementation libs.junit.params
18 testImplementation libs.mockito.core
19 testImplementation libs.mockito.junit
20}
21
12sourceCompatibility = '17' 22sourceCompatibility = '17'
13targetCompatibility = '17' 23targetCompatibility = '17'
14 24
25def jacocoTestReport = tasks.named('jacocoTestReport')
26jacocoTestReport.configure {
27 dependsOn test
28 reports {
29 xml.required = true
30 }
31}
32
33tasks.named('test') {
34 useJUnitPlatform {
35 excludeTags 'slow'
36 }
37 finalizedBy jacocoTestReport
38}
39
40tasks.register('slowTest', Test) {
41 useJUnitPlatform()
42 finalizedBy jacocoTestReport
43}
44
15tasks.named('jar') { 45tasks.named('jar') {
16 manifest { 46 manifest {
17 attributes 'Bundle-SymbolicName': project.name 47 attributes 'Bundle-SymbolicName': project.name
diff --git a/buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle b/buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle
deleted file mode 100644
index d62207b7..00000000
--- a/buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle
+++ /dev/null
@@ -1,33 +0,0 @@
1plugins {
2 id 'jacoco'
3 id 'tools.refinery.java-conventions'
4}
5
6dependencies {
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
15def jacocoTestReport = tasks.named('jacocoTestReport')
16jacocoTestReport.configure {
17 dependsOn test
18 reports {
19 xml.required = true
20 }
21}
22
23tasks.named('test') {
24 useJUnitPlatform {
25 excludeTags 'slow'
26 }
27 finalizedBy jacocoTestReport
28}
29
30tasks.register('slowTest', Test) {
31 useJUnitPlatform()
32 finalizedBy jacocoTestReport
33}