import org.redline_rpm.header.Os plugins { id 'application' id "com.github.johnrengelman.shadow" version "7.0.0" id "net.nemerosa.versioning" version "2.14.0" id "nebula.ospackage" version "8.6.1" } dependencies { testImplementation project(':shared') implementation project(':shared') annotationProcessor(group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}") implementation group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}" annotationProcessor "info.picocli:picocli-codegen:${picocliVersion}" implementation "info.picocli:picocli:${picocliVersion}" implementation 'org.tomlj:tomlj:1.0.0' runtimeOnly(group: 'com.github.oshi', name: 'oshi-core', version: oshiVersion) { exclude(group: "org.slf4j") } implementation group: 'org.apache.camel', name: 'camel-core', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-main', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-http', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-jackson', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-bean', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-timer', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-stream', version: camelVersion } def projectName = "sysmon-client" application { // Define the main class for the application. mainClass.set('sysmon.client.Application') applicationDefaultJvmArgs = [ "-server", "-XX:+UseG1GC", "-Xmx32m" ] } run { systemProperty 'pf4j.pluginsDir', '../plugins/output/' } tasks.named('test') { // Use junit platform for unit tests. useJUnitPlatform() } 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(), ) } } shadowJar { archiveBaseName.set(projectName) archiveClassifier.set('') archiveVersion.set('') mergeServiceFiles() // Tell plugin to merge duplicate service files } apply plugin: 'nebula.ospackage' ospackage { packageName = projectName release = '1' user = 'root' packager = "Mark Nellemann " into '/opt/sysmon/client' from(shadowJar.outputs.files) { into 'lib' } from('build/scriptsShadow') { into 'bin' } from('doc/') { into 'doc' } from(['README.md', 'LICENSE']) { into 'doc' } } buildDeb { dependsOn startShadowScripts } buildRpm { dependsOn startShadowScripts os = Os.LINUX } task buildRpmAix(type: Rpm) { dependsOn startShadowScripts packageName = "${projectName}-AIX" os = Os.AIX }