plugins { id 'java' id 'groovy' id 'application' id "com.github.johnrengelman.shadow" version "7.1.2" id "net.nemerosa.versioning" version "2.15.1" id "nebula.ospackage" version "9.1.1" } repositories { mavenCentral() } dependencies { annotationProcessor 'info.picocli:picocli-codegen:4.6.2' implementation 'info.picocli:picocli:4.6.3' implementation 'org.slf4j:slf4j-api:1.7.36' implementation 'org.slf4j:slf4j-simple:1.7.36' testImplementation('org.spockframework:spock-core:2.0-groovy-3.0') testImplementation 'org.slf4j:slf4j-api:1.7.36' testRuntimeOnly('org.slf4j:slf4j-simple:1.7.36') } application { getMainClass().set('biz.nellemann.syslogd.Application') } test { useJUnitPlatform() } apply plugin: 'nebula.ospackage' ospackage { packageName = 'syslogd' release = '1' user = 'root' packager = "Mark Nellemann " into '/opt/syslogd' from(shadowJar.outputs.files) { into 'lib' } from('build/scriptsShadow') { into 'bin' } from('doc/') { into 'doc' } from(['README.md', 'LICENSE']) { into 'doc' } } buildRpm { dependsOn startShadowScripts os = "LINUX" } buildDeb { dependsOn startShadowScripts } 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(), ) } } sourceCompatibility = 1.8 targetCompatibility = 1.8