2021-05-13 17:28:31 +00:00
|
|
|
import org.redline_rpm.header.Os
|
|
|
|
|
2021-04-25 13:25:20 +00:00
|
|
|
plugins {
|
|
|
|
id 'application'
|
2021-05-07 15:53:47 +00:00
|
|
|
|
2021-05-11 13:37:23 +00:00
|
|
|
id "com.github.johnrengelman.shadow" version "7.0.0"
|
2021-05-07 15:53:47 +00:00
|
|
|
id "net.nemerosa.versioning" version "2.14.0"
|
2021-05-11 13:37:23 +00:00
|
|
|
id "nebula.ospackage" version "8.5.6"
|
2021-04-25 13:25:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
testImplementation project(':shared')
|
|
|
|
implementation project(':shared')
|
|
|
|
|
2021-05-01 12:44:55 +00:00
|
|
|
annotationProcessor(group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}")
|
|
|
|
implementation group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}"
|
2021-04-25 13:25:20 +00:00
|
|
|
|
2021-05-07 15:53:47 +00:00
|
|
|
annotationProcessor "info.picocli:picocli-codegen:${picocliVersion}"
|
|
|
|
implementation "info.picocli:picocli:${picocliVersion}"
|
2021-05-17 13:05:35 +00:00
|
|
|
implementation 'org.tomlj:tomlj:1.0.0'
|
2021-05-07 15:53:47 +00:00
|
|
|
|
2021-05-28 13:52:33 +00:00
|
|
|
implementation(group: 'com.github.oshi', name: 'oshi-core', version: "5.7.3") {
|
|
|
|
exclude(group: "org.slf4j")
|
|
|
|
}
|
|
|
|
|
2021-05-04 15:54:47 +00:00
|
|
|
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
|
2021-04-25 13:25:20 +00:00
|
|
|
}
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
def projectName = "sysmon-client"
|
|
|
|
|
2021-04-25 13:25:20 +00:00
|
|
|
application {
|
|
|
|
// Define the main class for the application.
|
2021-05-21 09:08:43 +00:00
|
|
|
mainClass.set('sysmon.client.Application')
|
2021-05-01 12:44:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
run {
|
2021-05-07 10:39:55 +00:00
|
|
|
systemProperty 'pf4j.pluginsDir', '../plugins/output/'
|
2021-04-25 13:25:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named('test') {
|
|
|
|
// Use junit platform for unit tests.
|
|
|
|
useJUnitPlatform()
|
2021-05-07 15:53:47 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 20:47:40 +00:00
|
|
|
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
|
|
|
|
}
|
2021-05-07 15:53:47 +00:00
|
|
|
|
|
|
|
apply plugin: 'nebula.ospackage'
|
|
|
|
ospackage {
|
2021-05-13 17:28:31 +00:00
|
|
|
packageName = projectName
|
2021-05-07 15:53:47 +00:00
|
|
|
release = '1'
|
|
|
|
user = 'root'
|
|
|
|
packager = "Mark Nellemann <mark.nellemann@gmail.com>"
|
|
|
|
|
2021-05-11 13:37:23 +00:00
|
|
|
into '/opt/sysmon/client'
|
2021-05-07 15:53:47 +00:00
|
|
|
|
|
|
|
from(shadowJar.outputs.files) {
|
|
|
|
into 'lib'
|
|
|
|
}
|
|
|
|
|
|
|
|
from('build/scriptsShadow') {
|
|
|
|
into 'bin'
|
|
|
|
}
|
|
|
|
|
|
|
|
from('doc/') {
|
|
|
|
into 'doc'
|
|
|
|
}
|
|
|
|
|
|
|
|
from(['README.md', 'LICENSE']) {
|
|
|
|
into 'doc'
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
buildDeb {
|
|
|
|
dependsOn startShadowScripts
|
|
|
|
}
|
|
|
|
|
2021-05-07 15:53:47 +00:00
|
|
|
buildRpm {
|
|
|
|
dependsOn startShadowScripts
|
2021-05-13 17:28:31 +00:00
|
|
|
os = Os.LINUX
|
2021-05-07 15:53:47 +00:00
|
|
|
}
|
|
|
|
|
2021-05-13 17:28:31 +00:00
|
|
|
task buildRpmAix(type: Rpm) {
|
2021-05-07 15:53:47 +00:00
|
|
|
dependsOn startShadowScripts
|
2021-05-13 17:28:31 +00:00
|
|
|
packageName = "${projectName}-AIX"
|
|
|
|
os = Os.AIX
|
2021-05-07 15:53:47 +00:00
|
|
|
}
|