2020-08-07 06:13:48 +00:00
|
|
|
plugins {
|
2020-10-09 08:20:50 +00:00
|
|
|
id 'java'
|
2023-04-04 20:22:10 +00:00
|
|
|
id 'jacoco'
|
2020-08-07 06:13:48 +00:00
|
|
|
id 'groovy'
|
|
|
|
id 'application'
|
2022-02-08 20:39:42 +00:00
|
|
|
id "net.nemerosa.versioning" version "2.15.1"
|
2023-11-13 13:14:27 +00:00
|
|
|
id "com.netflix.nebula.ospackage" version "11.5.0"
|
2023-01-04 14:41:59 +00:00
|
|
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
2021-06-03 16:08:58 +00:00
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
2022-02-08 20:39:42 +00:00
|
|
|
group = projectGroup
|
|
|
|
version = projectVersion
|
|
|
|
|
2020-08-07 06:13:48 +00:00
|
|
|
dependencies {
|
2023-11-13 13:14:27 +00:00
|
|
|
annotationProcessor 'info.picocli:picocli-codegen:4.7.5'
|
|
|
|
implementation 'info.picocli:picocli:4.7.5'
|
|
|
|
implementation 'org.slf4j:slf4j-api:2.0.9'
|
|
|
|
implementation 'org.slf4j:slf4j-simple:2.0.9'
|
2023-08-10 09:02:53 +00:00
|
|
|
implementation 'com.squareup.okhttp3:okhttp:4.11.0' // Also used by InfluxDB Client
|
|
|
|
implementation 'com.influxdb:influxdb-client-java:6.10.0'
|
|
|
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
|
|
|
|
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.2'
|
|
|
|
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.15.2'
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
2023-04-04 20:22:10 +00:00
|
|
|
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
|
2022-11-24 11:35:49 +00:00
|
|
|
testImplementation "org.mock-server:mockserver-netty-no-dependencies:5.14.0"
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2021-06-03 16:08:58 +00:00
|
|
|
mainClass.set('biz.nellemann.hmci.Application')
|
2022-12-07 15:12:29 +00:00
|
|
|
applicationDefaultJvmArgs = [ "-server", "-Xms64m", "-Xmx256m", "-XX:+UseG1GC", "-XX:+ExitOnOutOfMemoryError", "-XX:+AlwaysPreTouch" ]
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
2022-09-20 15:55:40 +00:00
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
2020-08-07 06:13:48 +00:00
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
2020-08-13 15:50:26 +00:00
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
|
2020-08-13 15:50:26 +00:00
|
|
|
ospackage {
|
|
|
|
packageName = 'hmci'
|
|
|
|
release = '1'
|
2020-08-13 20:01:22 +00:00
|
|
|
user = 'root'
|
|
|
|
packager = "Mark Nellemann <mark.nellemann@gmail.com>"
|
2020-08-13 15:50:26 +00:00
|
|
|
|
|
|
|
into '/opt/hmci'
|
|
|
|
|
|
|
|
from(shadowJar.outputs.files) {
|
|
|
|
into 'lib'
|
|
|
|
}
|
|
|
|
|
|
|
|
from('build/scriptsShadow') {
|
|
|
|
into 'bin'
|
|
|
|
}
|
|
|
|
|
2020-08-14 09:50:44 +00:00
|
|
|
from('doc/') {
|
|
|
|
into 'doc'
|
2020-08-13 15:50:26 +00:00
|
|
|
}
|
2020-08-14 09:50:44 +00:00
|
|
|
|
2020-09-14 11:28:25 +00:00
|
|
|
from(['README.md', 'LICENSE']) {
|
|
|
|
into 'doc'
|
|
|
|
}
|
|
|
|
|
2020-08-13 15:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buildRpm {
|
|
|
|
dependsOn startShadowScripts
|
2020-10-12 08:15:53 +00:00
|
|
|
os = "LINUX"
|
2020-08-13 15:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buildDeb {
|
|
|
|
dependsOn startShadowScripts
|
|
|
|
}
|
2020-08-17 12:23:15 +00:00
|
|
|
|
|
|
|
jacoco {
|
2023-04-04 20:22:10 +00:00
|
|
|
toolVersion = "0.8.9"
|
2020-08-17 12:23:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
group = "verification"
|
|
|
|
reports {
|
2021-08-09 13:06:47 +00:00
|
|
|
xml.required = false
|
|
|
|
csv.required = false
|
2020-08-17 12:23:15 +00:00
|
|
|
html.destination file("${buildDir}/reports/coverage")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
test.finalizedBy jacocoTestReport
|
|
|
|
|
|
|
|
jacocoTestCoverageVerification {
|
|
|
|
violationRules {
|
|
|
|
rule {
|
|
|
|
limit {
|
2022-11-24 11:35:49 +00:00
|
|
|
minimum = 0.4
|
2020-08-17 12:23:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
check.dependsOn jacocoTestCoverageVerification
|
2020-09-10 06:35:03 +00:00
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
'Created-By' : "Gradle ${gradle.gradleVersion}",
|
2020-10-09 08:20:50 +00:00
|
|
|
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
|
2020-09-10 06:35:03 +00:00
|
|
|
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
|
2020-10-09 08:20:50 +00:00
|
|
|
'Build-User' : System.properties['user.name'],
|
|
|
|
'Build-Version' : versioning.info.tag ?: (versioning.info.branch + "-" + versioning.info.build),
|
|
|
|
'Build-Revision' : versioning.info.commit,
|
|
|
|
'Build-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ").toString(),
|
2021-01-05 13:53:52 +00:00
|
|
|
'Add-Opens' : 'java.base/java.lang.invoke' // To ignore "Illegal reflective access by retrofit2.Platform" warnings
|
2020-09-10 06:35:03 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2020-12-21 10:41:48 +00:00
|
|
|
|
2023-01-04 14:41:59 +00:00
|
|
|
tasks.register("packages") {
|
2021-09-20 13:36:23 +00:00
|
|
|
group "build"
|
|
|
|
dependsOn ":build"
|
|
|
|
dependsOn ":buildDeb"
|
|
|
|
dependsOn ":buildRpm"
|
|
|
|
}
|