2021-05-13 17:28:31 +00:00
|
|
|
import org.redline_rpm.header.Os
|
|
|
|
|
2021-05-11 13:37:23 +00:00
|
|
|
plugins {
|
2021-12-05 20:17:16 +00:00
|
|
|
id "nebula.ospackage" version "9.0.0"
|
2021-05-11 13:37:23 +00:00
|
|
|
}
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
|
2021-05-01 12:44:55 +00:00
|
|
|
subprojects {
|
2021-05-04 10:08:24 +00:00
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'groovy'
|
|
|
|
|
|
|
|
dependencies {
|
2021-05-21 09:08:43 +00:00
|
|
|
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
|
2021-05-04 10:08:24 +00:00
|
|
|
testImplementation "org.slf4j:slf4j-api:${slf4jVersion}"
|
2021-06-08 18:24:43 +00:00
|
|
|
testImplementation "org.slf4j:slf4j-simple:${slf4jVersion}"
|
2021-05-04 10:08:24 +00:00
|
|
|
testImplementation project(':shared')
|
|
|
|
|
|
|
|
implementation project(':shared')
|
2021-05-27 20:43:56 +00:00
|
|
|
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
|
2021-05-04 10:08:24 +00:00
|
|
|
implementation(group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}") {
|
|
|
|
exclude(group: "org.slf4j")
|
|
|
|
}
|
|
|
|
annotationProcessor(group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}")
|
2021-05-28 13:52:33 +00:00
|
|
|
|
2021-06-11 10:57:37 +00:00
|
|
|
compileOnly(group: 'com.github.oshi', name: 'oshi-core', version: oshiVersion) {
|
2021-05-28 13:52:33 +00:00
|
|
|
exclude(group: "org.slf4j")
|
|
|
|
}
|
|
|
|
|
2021-05-04 10:08:24 +00:00
|
|
|
}
|
2021-05-01 12:44:55 +00:00
|
|
|
|
2021-05-27 20:43:56 +00:00
|
|
|
task uberJar(type: Jar) {
|
|
|
|
from sourceSets.main.output
|
|
|
|
dependsOn configurations.runtimeClasspath
|
|
|
|
from {
|
|
|
|
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect {
|
|
|
|
zipTree(it).matching {
|
2021-05-28 06:49:42 +00:00
|
|
|
exclude 'org/pf4j/**'
|
2021-05-27 20:43:56 +00:00
|
|
|
exclude 'org/slf4j/**'
|
2021-05-28 06:49:42 +00:00
|
|
|
exclude 'sysmon/shared/**'
|
|
|
|
exclude 'META-INF/AL2.0'
|
|
|
|
exclude 'META-INF/LGPL2.1'
|
|
|
|
exclude 'META-INF/LICENSE'
|
2021-05-27 20:43:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
'Plugin-Id' : "${pluginId}",
|
|
|
|
'Plugin-Class' : "${pluginClass}",
|
2021-12-05 20:17:16 +00:00
|
|
|
'Plugin-Version' : "${archiveVersion}",
|
2021-06-10 06:55:03 +00:00
|
|
|
'Plugin-Provider' : "System Monitor",
|
2021-05-27 20:43:56 +00:00
|
|
|
'Plugin-Description': "${pluginDescription}"
|
|
|
|
)
|
|
|
|
}
|
2021-05-01 12:44:55 +00:00
|
|
|
}
|
|
|
|
|
2021-05-27 20:43:56 +00:00
|
|
|
task copyJar(type: Copy, dependsOn: ['uberJar']) {
|
|
|
|
from jar
|
2021-05-07 10:39:55 +00:00
|
|
|
into "../output/"
|
2021-05-01 12:44:55 +00:00
|
|
|
}
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
tasks.build.dependsOn {
|
2021-05-27 20:43:56 +00:00
|
|
|
uberJar
|
2021-05-01 12:44:55 +00:00
|
|
|
copyJar
|
|
|
|
}
|
|
|
|
|
2021-05-04 10:08:24 +00:00
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceCompatibility = 1.8
|
|
|
|
targetCompatibility = 1.8
|
2021-05-01 12:44:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
task customCleanUp(type:Delete) {
|
2021-05-07 10:39:55 +00:00
|
|
|
delete "output"
|
2021-05-01 12:44:55 +00:00
|
|
|
}
|
|
|
|
|
2021-05-11 13:37:23 +00:00
|
|
|
tasks.clean.dependsOn(tasks.customCleanUp)
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
def projectName = "sysmon-plugins"
|
|
|
|
|
2021-05-11 13:37:23 +00:00
|
|
|
|
|
|
|
apply plugin: 'nebula.ospackage'
|
|
|
|
ospackage {
|
2021-05-13 17:28:31 +00:00
|
|
|
packageName = projectName
|
2021-05-11 13:37:23 +00:00
|
|
|
release = '1'
|
|
|
|
user = 'root'
|
|
|
|
packager = "Mark Nellemann <mark.nellemann@gmail.com>"
|
|
|
|
|
|
|
|
into '/opt/sysmon/plugins'
|
|
|
|
|
|
|
|
from('output/') {
|
|
|
|
into ''
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
buildDeb {
|
|
|
|
subprojects.each { dependsOn("${it.name}:build") }
|
|
|
|
}
|
|
|
|
|
2021-05-11 13:37:23 +00:00
|
|
|
buildRpm {
|
2021-05-13 17:28:31 +00:00
|
|
|
subprojects.each { dependsOn("${it.name}:build") }
|
|
|
|
os = Os.LINUX
|
2021-05-11 13:37:23 +00:00
|
|
|
}
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
task buildRpmAix(type: Rpm) {
|
|
|
|
subprojects.each { dependsOn("${it.name}:build") }
|
|
|
|
packageName = "${projectName}-AIX"
|
|
|
|
os = Os.AIX
|
2021-05-11 13:37:23 +00:00
|
|
|
}
|