diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-11-17 03:09:48 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-11-17 03:09:48 +0100 |
commit | 34ec8e86c6414a6b071ccd65fc0dad0d56d0f368 (patch) | |
tree | 3ebbe359988eb5740e7429d1ac5c6c35bc4bac8f /buildSrc | |
parent | build: move scripts into script plugins (diff) | |
download | refinery-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.gradle | 30 | ||||
-rw-r--r-- | buildSrc/src/main/groovy/tools.refinery.junit-conventions.gradle | 33 |
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 @@ | |||
1 | plugins { | 1 | plugins { |
2 | id 'eclipse' | 2 | id 'eclipse' |
3 | id 'jacoco' | ||
3 | } | 4 | } |
4 | 5 | ||
5 | repositories { | 6 | repositories { |
@@ -9,9 +10,38 @@ repositories { | |||
9 | } | 10 | } |
10 | } | 11 | } |
11 | 12 | ||
13 | dependencies { | ||
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 | |||
12 | sourceCompatibility = '17' | 22 | sourceCompatibility = '17' |
13 | targetCompatibility = '17' | 23 | targetCompatibility = '17' |
14 | 24 | ||
25 | def jacocoTestReport = tasks.named('jacocoTestReport') | ||
26 | jacocoTestReport.configure { | ||
27 | dependsOn test | ||
28 | reports { | ||
29 | xml.required = true | ||
30 | } | ||
31 | } | ||
32 | |||
33 | tasks.named('test') { | ||
34 | useJUnitPlatform { | ||
35 | excludeTags 'slow' | ||
36 | } | ||
37 | finalizedBy jacocoTestReport | ||
38 | } | ||
39 | |||
40 | tasks.register('slowTest', Test) { | ||
41 | useJUnitPlatform() | ||
42 | finalizedBy jacocoTestReport | ||
43 | } | ||
44 | |||
15 | tasks.named('jar') { | 45 | tasks.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 @@ | |||
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 | } | ||