sysmon/plugins/build.gradle

122 lines
2.9 KiB
Groovy
Raw Normal View History

import org.redline_rpm.header.Os
plugins {
id "nebula.ospackage" version "8.5.6"
}
2021-05-01 12:44:55 +00:00
subprojects {
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'
testImplementation "org.slf4j:slf4j-api:${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}")
}
2021-05-01 12:44:55 +00:00
/*
2021-05-01 12:44:55 +00:00
jar {
manifest {
attributes(
'Plugin-Id' : "${pluginId}",
'Plugin-Class' : "${pluginClass}",
'Plugin-Version' : "${pluginVersion}",
'Plugin-Provider' : "${pluginProvider}",
'Plugin-Description': "${pluginDescription}"
)
}
}*/
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/**'
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'
}
}
}
manifest {
attributes(
'Plugin-Id' : "${pluginId}",
'Plugin-Class' : "${pluginClass}",
'Plugin-Version' : "${pluginVersion}",
'Plugin-Provider' : "${pluginProvider}",
'Plugin-Description': "${pluginDescription}"
)
}
2021-05-01 12:44:55 +00:00
}
task copyJar(type: Copy, dependsOn: ['uberJar']) {
from jar
into "../output/"
2021-05-01 12:44:55 +00:00
}
tasks.build.dependsOn {
uberJar
2021-05-01 12:44:55 +00:00
copyJar
}
test {
useJUnitPlatform()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
2021-05-01 12:44:55 +00:00
}
task customCleanUp(type:Delete) {
delete "output"
2021-05-01 12:44:55 +00:00
}
tasks.clean.dependsOn(tasks.customCleanUp)
def projectName = "sysmon-plugins"
apply plugin: 'nebula.ospackage'
ospackage {
packageName = projectName
release = '1'
user = 'root'
packager = "Mark Nellemann <mark.nellemann@gmail.com>"
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
}