2020-08-07 06:13:48 +00:00
|
|
|
plugins {
|
2020-10-09 08:20:50 +00:00
|
|
|
id 'java'
|
2020-08-07 06:13:48 +00:00
|
|
|
id 'groovy'
|
|
|
|
id 'application'
|
2020-08-13 15:50:26 +00:00
|
|
|
|
2020-08-17 12:23:15 +00:00
|
|
|
// Code coverage of tests
|
|
|
|
id 'jacoco'
|
|
|
|
|
2020-12-01 10:47:54 +00:00
|
|
|
id "com.github.johnrengelman.shadow" version "6.1.0"
|
2020-09-10 06:35:03 +00:00
|
|
|
id "net.nemerosa.versioning" version "2.14.0"
|
2020-08-13 15:50:26 +00:00
|
|
|
id "nebula.ospackage" version "8.4.1"
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-12-01 10:47:54 +00:00
|
|
|
annotationProcessor 'info.picocli:picocli-codegen:4.5.2'
|
|
|
|
implementation 'info.picocli:picocli:4.5.2'
|
2020-10-09 14:32:16 +00:00
|
|
|
implementation 'org.jsoup:jsoup:1.13.1'
|
2020-10-14 08:41:31 +00:00
|
|
|
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
2020-10-09 14:32:16 +00:00
|
|
|
implementation 'com.squareup.moshi:moshi:1.11.0'
|
2020-10-11 10:25:55 +00:00
|
|
|
implementation 'com.serjltt.moshi:moshi-lazy-adapters:2.2'
|
2020-10-09 08:20:50 +00:00
|
|
|
implementation 'org.tomlj:tomlj:1.0.0'
|
2020-10-14 08:41:31 +00:00
|
|
|
implementation 'org.influxdb:influxdb-java:2.20'
|
2020-08-07 06:13:48 +00:00
|
|
|
implementation 'org.slf4j:slf4j-api:1.7.+'
|
|
|
|
runtimeOnly 'ch.qos.logback:logback-classic:1.+'
|
|
|
|
|
2020-12-01 10:47:54 +00:00
|
|
|
testImplementation('org.spockframework:spock-core:2.0-M4-groovy-3.0')
|
2020-10-14 15:28:43 +00:00
|
|
|
testImplementation('com.squareup.okhttp3:mockwebserver:4.9.0')
|
2020-08-07 06:13:48 +00:00
|
|
|
testImplementation("org.slf4j:slf4j-simple:1.7.+")
|
2020-08-10 13:44:14 +00:00
|
|
|
//implementation platform('org.testcontainers:testcontainers-bom:1.14.3') //import bom
|
|
|
|
//testCompile "org.testcontainers:influxdb:1.14.3"
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2020-10-09 08:20:50 +00:00
|
|
|
mainClassName = 'biz.nellemann.hmci.Main'
|
2020-08-07 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
2020-08-13 15:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'nebula.ospackage'
|
|
|
|
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-10-02 06:43:13 +00:00
|
|
|
requires('default-jre-headless')
|
2020-08-13 15:50:26 +00:00
|
|
|
}
|
2020-08-17 12:23:15 +00:00
|
|
|
|
|
|
|
jacoco {
|
|
|
|
toolVersion = "0.8.5"
|
|
|
|
}
|
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
group = "verification"
|
|
|
|
reports {
|
|
|
|
xml.enabled false
|
|
|
|
csv.enabled false
|
|
|
|
html.destination file("${buildDir}/reports/coverage")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
test.finalizedBy jacocoTestReport
|
|
|
|
|
|
|
|
jacocoTestCoverageVerification {
|
|
|
|
violationRules {
|
|
|
|
rule {
|
|
|
|
limit {
|
2020-10-14 08:41:31 +00:00
|
|
|
minimum = 0.4 // TODO: Raise when more tests are implemented
|
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(),
|
2020-09-10 06:35:03 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|