This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
119 lines (98 loc) · 1.96 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
plugins {
id 'groovy'
id 'application'
id 'codenarc'
id 'jacoco'
id 'jacoco-report-aggregation'
}
wrapper {
gradleVersion = '8.3'
distributionType = Wrapper.DistributionType.ALL
}
version = '3.0.0'
group = 'rkrisztian.search'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
dependencies {
def groovyVersion = '3.0.17'
implementation "org.codehaus.groovy:groovy-all:$groovyVersion"
codenarc 'org.codenarc:CodeNarc:3.3.0'
codenarc "org.codehaus.groovy:groovy-all:$groovyVersion"
}
testing {
suites {
configureEach {
useJUnitJupiter()
dependencies {
implementation 'org.spockframework:spock-core:2.3-groovy-3.0'
}
targets.all {
testTask.configure() {
testLogging { events 'skipped', 'failed' }
}
}
}
integrationTest(JvmTestSuite) {
dependencies {
implementation project()
implementation configurations.testCompileClasspath
implementation sourceSets.test.output
}
targets.all {
testTask.configure {
systemProperty 'java.io.tmpdir', "${-> layout.buildDirectory.dir('tmp').get()}"
}
}
}
}
}
application {
applicationName = 'search'
mainClass = 'search.Search'
}
distributions {
main {
contents {
from('README.md') {
into 'docs'
}
}
}
}
tasks.named('jar') {
manifest {
attributes 'Implementation-Title': 'Search App',
'Implementation-Version': archiveVersion
}
}
codenarc {
configFile = file 'config/codenarc/rules.groovy'
reportFormat = 'html'
}
jacoco {
toolVersion = '0.8.10'
}
tasks.named('jacocoTestReport') {
enabled = false
}
tasks.register('codeCoverageReport', JacocoReport) {
sourceSets sourceSets.main
tasks.matching({ t -> t.extensions.findByType(JacocoTaskExtension) }).forEach { testTask ->
executionData testTask
dependsOn testTask
}
reports {
xml.required = true
html.required = true
}
}
tasks.named('check') {
dependsOn testing.suites.integrationTest
dependsOn 'codeCoverageReport'
}