import org.redline_rpm.header.Os plugins { id "com.netflix.nebula.ospackage" version "11.3.0" } subprojects { apply plugin: 'java' apply plugin: 'groovy' dependencies { testImplementation "org.spockframework:spock-core:${spockVersion}" testImplementation "org.slf4j:slf4j-api:${slf4jVersion}" testImplementation "org.slf4j:slf4j-simple:${slf4jVersion}" testImplementation project(':shared') implementation project(':shared') implementation "org.slf4j:slf4j-api:${slf4jVersion}" implementation(group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}") { exclude(group: "org.slf4j") } annotationProcessor(group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}") compileOnly(group: 'com.github.oshi', name: 'oshi-core', version: oshiVersion) { exclude(group: "org.slf4j") } } task uberJar(type: Jar) { duplicatesStrategy DuplicatesStrategy.EXCLUDE from sourceSets.main.output dependsOn configurations.runtimeClasspath from { configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it).matching { exclude 'org/pf4j/**' exclude 'org/slf4j/**' exclude 'sysmon/shared/**' exclude 'META-INF/AL2.0' exclude 'META-INF/LGPL2.1' exclude 'META-INF/LICENSE' } } } manifest { attributes( 'Plugin-Id' : "${pluginId}", 'Plugin-Class' : "${pluginClass}", 'Plugin-Version' : "${archiveVersion}", 'Plugin-Provider' : "System Monitor", 'Plugin-Description': "${pluginDescription}" ) } } task copyJar(type: Copy, dependsOn: ['uberJar']) { from jar into "../output/" } tasks.build.dependsOn { uberJar copyJar } test { useJUnitPlatform() } sourceCompatibility = 1.8 targetCompatibility = 1.8 } task customCleanUp(type:Delete) { delete "output" } tasks.clean.dependsOn(tasks.customCleanUp) def projectName = "sysmon-plugins" ospackage { packageName = projectName release = '1' user = 'root' packager = "Mark Nellemann " into '/opt/sysmon/plugins' from('output/') { into '' } } buildDeb { subprojects.each { dependsOn("${it.name}:build") } } buildRpm { subprojects.each { dependsOn("${it.name}:build") } os = Os.LINUX } task buildRpmAix(type: Rpm) { subprojects.each { dependsOn("${it.name}:build") } packageName = "${projectName}-AIX" os = Os.AIX } task buildZip(type: Zip) { subprojects.each { dependsOn("${it.name}:copyJar") } from "output" setArchivesBaseName(projectName as String) setArchiveVersion(project.property("version") as String) }