-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (135 loc) · 3.85 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import org.redline_rpm.header.Os
plugins {
id 'java'
id 'groovy'
id 'application'
id 'jacoco'
id 'com.palantir.git-version' version "3.1.0"
id "com.netflix.nebula.ospackage" version "11.8.1"
id "com.github.johnrengelman.shadow" version "7.1.2"
}
repositories {
mavenCentral()
}
dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.7.6'
implementation 'info.picocli:picocli:4.7.6'
implementation 'org.slf4j:slf4j-api:2.0.13'
implementation 'org.slf4j:slf4j-simple:2.0.13'
implementation 'ro.pippo:pippo-core:1.14.0'
implementation 'ro.pippo:pippo-undertow:1.14.0'
implementation 'ro.pippo:pippo-freemarker:1.14.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.4'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.4'
implementation 'org.apache.commons:commons-collections4:4.4'
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
}
application {
getMainClass().set('biz.nellemann.syslogd.Main')
}
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
test {
useJUnitPlatform()
}
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
group = "verification"
reports {
xml.required = false
csv.required = false
html.destination file("${buildDir}/reports/coverage")
}
}
test.finalizedBy jacocoTestReport
jacocoTestCoverageVerification {
violationRules {
rule {
includes = ['biz.nellemann.syslogd.parser.*']
limit {
counter = 'LINE'
minimum = 0.8
}
limit {
counter = 'BRANCH'
minimum = 0.8
}
limit {
counter = 'CLASS'
minimum = 0.8
}
}
rule {
includes = ['biz.nellemann.syslogd.msg.*']
limit {
counter = 'LINE'
minimum = 0.8
}
limit {
counter = 'BRANCH'
minimum = 0.8
}
limit {
counter = 'CLASS'
minimum = 0.8
}
}
}
}
check.dependsOn jacocoTestCoverageVerification
jar {
manifest {
attributes(
'Created-By' : "Gradle ${gradle.gradleVersion}",
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-User' : System.properties['user.name'],
'Build-Version' : gitVersion(),
'Build-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ").toString(),
)
}
}
tasks.register("packages") {
group "build"
dependsOn ":build"
dependsOn ":buildDeb"
dependsOn ":buildRpm"
}
ospackage {
packageName = 'syslogd'
release = '1'
user = 'root'
packager = "Mark Nellemann <mark.nellemann@gmail.com>"
into '/opt/syslogd'
from(shadowJar.outputs.files) {
into 'lib'
}
from('build/scriptsShadow') {
into 'bin'
}
from('doc/') {
into 'doc'
}
from(['README.md', 'LICENSE']) {
into 'doc'
}
}
buildDeb {
dependsOn startShadowScripts
installUtils file('scripts/utils.sh') as File
installUtils file('scripts/config.sh') as File
preUninstall file('scripts/deb-pre-rm.sh') as File
postInstall file('scripts/deb-post-inst.sh') as File
}
buildRpm {
dependsOn startShadowScripts
installUtils file('scripts/utils.sh') as File
installUtils file('scripts/config.sh') as File
preUninstall file('scripts/rpm-pre-rm.sh') as File
postTrans file('scripts/rpm-post-inst.sh') as File
os Os.LINUX
}