hmci/build.gradle

132 lines
3.2 KiB
Groovy
Raw Normal View History

2020-08-07 06:13:48 +00:00
plugins {
id 'java'
2020-08-07 06:13:48 +00:00
id 'groovy'
id 'application'
// Code coverage of tests
id 'jacoco'
id "com.github.johnrengelman.shadow" version "7.0.0"
id "net.nemerosa.versioning" version "2.14.0"
id "nebula.ospackage" version "8.5.6"
2020-08-07 06:13:48 +00:00
}
repositories {
mavenCentral()
mavenLocal()
2020-08-07 06:13:48 +00:00
}
dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.6.1'
implementation 'info.picocli:picocli:4.6.1'
implementation 'org.jsoup:jsoup:1.14.3'
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
implementation 'com.squareup.moshi:moshi:1.12.0'
implementation 'com.serjltt.moshi:moshi-lazy-adapters:2.2'
implementation 'org.tomlj:tomlj:1.0.0'
implementation 'org.influxdb:influxdb-java:2.21'
implementation 'org.slf4j:slf4j-api:1.7.32'
implementation 'org.slf4j:slf4j-simple:1.7.32'
2020-08-07 06:13:48 +00:00
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.2'
testImplementation 'org.slf4j:slf4j-simple:1.7.32'
2020-08-07 06:13:48 +00:00
}
application {
mainClass.set('biz.nellemann.hmci.Application')
applicationDefaultJvmArgs = [ "-server", "-Xms256m", "-Xmx1024m", "-XX:+UseG1GC" ]
2020-08-07 06:13:48 +00:00
}
test {
useJUnitPlatform()
}
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>"
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-14 09:50:44 +00:00
from(['README.md', 'LICENSE']) {
into 'doc'
}
}
buildRpm {
dependsOn startShadowScripts
os = "LINUX"
}
buildDeb {
dependsOn startShadowScripts
}
jacoco {
2021-09-08 10:54:51 +00:00
toolVersion = "0.8.7"
}
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.5 // TODO: Raise when more tests are implemented
}
}
}
}
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' : 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(),
'Add-Opens' : 'java.base/java.lang.invoke' // To ignore "Illegal reflective access by retrofit2.Platform" warnings
)
}
}
tasks.create("packages") {
group "build"
dependsOn ":build"
dependsOn ":buildDeb"
dependsOn ":buildRpm"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8