syslogd/build.gradle

129 lines
2.9 KiB
Groovy
Raw Normal View History

2020-09-22 18:33:22 +00:00
plugins {
id 'java'
id 'groovy'
id 'application'
id 'jacoco'
2021-12-14 21:08:47 +00:00
id "net.nemerosa.versioning" version "2.15.1"
2023-10-02 12:25:33 +00:00
id "com.netflix.nebula.ospackage" version "11.5.0"
2023-01-03 11:49:21 +00:00
id "com.github.johnrengelman.shadow" version "7.1.2"
2020-09-22 18:33:22 +00:00
}
repositories {
2021-12-03 10:29:55 +00:00
mavenCentral()
2020-09-22 18:33:22 +00:00
}
dependencies {
2023-10-02 12:25:33 +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'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2'
2022-12-13 15:59:28 +00:00
implementation 'org.apache.commons:commons-collections4:4.4'
2021-12-03 10:29:55 +00:00
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
2020-09-22 18:33:22 +00:00
}
application {
2021-12-14 21:08:47 +00:00
getMainClass().set('biz.nellemann.syslogd.Application')
2020-09-22 18:33:22 +00:00
}
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
2020-09-22 18:33:22 +00:00
test {
useJUnitPlatform()
}
jacoco {
2023-10-02 12:25:33 +00:00
toolVersion = "0.8.10"
}
jacocoTestReport {
group = "verification"
reports {
xml.required = false
csv.required = false
html.destination file("${buildDir}/reports/coverage")
}
}
test.finalizedBy jacocoTestReport
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'LINE'
minimum = 0.3
}
limit {
counter = 'BRANCH'
minimum = 0.3
}
limit {
counter = 'CLASS'
minimum = 0.4
}
}
}
}
check.dependsOn jacocoTestCoverageVerification
2020-09-22 18:33:22 +00:00
ospackage {
packageName = 'syslogd'
release = '1'
user = 'root'
packager = "Mark Nellemann <mark.nellemann@gmail.com>"
into '/opt/syslogd'
from(shadowJar.outputs.files) {
into 'lib'
}
from('build/scriptsShadow') {
into 'bin'
}
from('doc/') {
into 'doc'
}
2020-09-22 18:33:22 +00:00
from(['README.md', 'LICENSE']) {
into 'doc'
}
}
buildRpm {
dependsOn startShadowScripts
2020-10-14 06:39:29 +00:00
os = "LINUX"
2020-09-22 18:33:22 +00:00
}
buildDeb {
dependsOn startShadowScripts
}
jar {
manifest {
attributes(
2020-10-07 13:09:59 +00:00
'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(),
2020-09-22 18:33:22 +00:00
)
}
}
2023-01-06 07:06:52 +00:00
tasks.register("packages") {
group "build"
dependsOn ":build"
dependsOn ":buildDeb"
dependsOn ":buildRpm"
}