2020-08-07 06:13:48 +00:00
|
|
|
plugins {
|
|
|
|
// Apply the groovy plugin to add support for Groovy
|
|
|
|
id 'groovy'
|
|
|
|
|
|
|
|
// Apply the application plugin to add support for building a CLI application.
|
|
|
|
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-08-13 15:50:26 +00:00
|
|
|
id "com.github.johnrengelman.shadow" version "6.0.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 {
|
|
|
|
implementation 'org.codehaus.groovy:groovy-all:3.0.5'
|
|
|
|
implementation 'com.squareup.okhttp3:okhttp:4.8.0'
|
2020-08-10 13:44:14 +00:00
|
|
|
implementation 'org.influxdb:influxdb-java:2.19'
|
2020-08-07 06:13:48 +00:00
|
|
|
implementation 'org.slf4j:slf4j-api:1.7.+'
|
|
|
|
runtimeOnly 'ch.qos.logback:logback-classic:1.+'
|
|
|
|
|
|
|
|
testImplementation('org.spockframework:spock-core:2.0-M3-groovy-3.0')
|
|
|
|
testImplementation("org.slf4j:slf4j-simple:1.7.+")
|
|
|
|
testImplementation('com.squareup.okhttp3:mockwebserver:4.8.0')
|
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 {
|
|
|
|
mainClassName = 'biz.nellemann.hmci.App'
|
|
|
|
}
|
|
|
|
|
|
|
|
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-08-13 15:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buildRpm {
|
|
|
|
dependsOn startShadowScripts
|
|
|
|
requires('java-1.8.0-openjdk-headless')
|
2020-08-14 09:50:44 +00:00
|
|
|
os = LINUX
|
2020-08-13 15:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buildDeb {
|
|
|
|
dependsOn startShadowScripts
|
|
|
|
requires('default-jre-headless')
|
|
|
|
}
|
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 {
|
|
|
|
minimum = 0.3 // FIXME: Raise when more tests are implemented
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
check.dependsOn jacocoTestCoverageVerification
|
2020-09-10 06:35:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
processResources.dependsOn.add("versionFile")
|
|
|
|
versionFile {
|
|
|
|
// Path to the file to be written
|
|
|
|
file = new File(project.buildDir, 'resources/main/version.properties')
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
'Built-By' : System.properties['user.name'],
|
|
|
|
'Build-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ").toString(),
|
|
|
|
'Build-Revision' : versioning.info.commit,
|
|
|
|
'Created-By' : "Gradle ${gradle.gradleVersion}",
|
|
|
|
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
|
|
|
|
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|