-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
143 lines (118 loc) · 3.87 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
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.4.0"
id "com.github.johnrengelman.shadow" version "7.1.2"
}
repositories {
mavenCentral()
mavenLocal()
}
group = projectGroup
version = projectVersion
dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.7.6'
implementation 'info.picocli:picocli:4.7.6'
implementation 'com.influxdb:influxdb-client-java:6.12.0'
implementation 'org.slf4j:slf4j-api:2.0.12'
implementation 'org.slf4j:slf4j-simple:2.0.13'
implementation 'org.apache.sshd:sshd-core:2.12.1' // Java SSH Client
implementation 'org.apache.sshd:sshd-scp:2.12.1' // Java SSH Client - SCP component
implementation 'com.squareup.okhttp3:okhttp:4.11.0' // Also used by InfluxDB Client
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.4'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.4'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.15.4'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
testImplementation "org.mock-server:mockserver-netty-no-dependencies:5.15.0"
}
application {
mainClass.set('biz.nellemann.svci.Application')
applicationDefaultJvmArgs = [ "-server", "-Xms64m", "-Xmx64m", "-XX:+UseG1GC", "-XX:+ExitOnOutOfMemoryError", "-XX:+AlwaysPreTouch" ]
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
test {
useJUnitPlatform()
}
ospackage {
packageName = 'svci'
release = '1'
user = 'root'
packager = "Mark Nellemann <[email protected]>"
into '/opt/svci'
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
}
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 {
limit {
minimum = 0.1
}
}
}
}
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(),
'Add-Opens' : 'java.base/java.lang.invoke' // To ignore "Illegal reflective access by retrofit2.Platform" warnings
)
}
}
tasks.register("packages") {
group "build"
dependsOn ":build"
dependsOn ":buildDeb"
dependsOn ":buildRpm"
}