sysmon/server/build.gradle

102 lines
3 KiB
Groovy
Raw Normal View History

import org.redline_rpm.header.Os
plugins {
id 'application'
2021-05-07 15:53:47 +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"
id "nebula.ospackage" version "8.6.1"
}
dependencies {
testImplementation project(':shared')
implementation project(':shared')
2021-05-07 15:53:47 +00:00
annotationProcessor "info.picocli:picocli-codegen:${picocliVersion}"
implementation "info.picocli:picocli:${picocliVersion}"
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-rest', version: camelVersion
implementation group: 'org.apache.camel', name: 'camel-jackson', version: camelVersion
implementation group: 'org.apache.camel', name: 'camel-influxdb', version: camelVersion
implementation group: 'org.apache.camel', name: 'camel-netty-http', version: camelVersion
}
def projectName = "sysmon-server"
application {
// Define the main class for the application.
2021-05-21 09:08:43 +00:00
mainClass.set('sysmon.server.Application')
2021-09-10 10:15:33 +00:00
applicationDefaultJvmArgs = [ "-server", "-Xms64m", "-Xmx128m", "-XX:+UseG1GC" ]
}
tasks.named('test') {
// Use junit platform for unit tests.
useJUnitPlatform()
}
2021-05-07 15:53:47 +00:00
apply plugin: 'nebula.ospackage'
ospackage {
packageName = projectName
2021-05-07 15:53:47 +00:00
release = '1'
user = 'root'
packager = "Mark Nellemann <mark.nellemann@gmail.com>"
into '/opt/sysmon/server'
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'
}
}
buildDeb {
2021-05-07 15:53:47 +00:00
dependsOn startShadowScripts
}
buildRpm {
2021-05-07 15:53:47 +00:00
dependsOn startShadowScripts
os = Os.LINUX
2021-05-07 15:53:47 +00:00
}
task buildRpmAix(type: Rpm) {
dependsOn startShadowScripts
packageName = "${projectName}-AIX"
os = Os.AIX
}
2021-05-07 15:53:47 +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(),
'Add-Opens' : 'java.base/java.lang.invoke' // To ignore "Illegal reflective access by retrofit2.Platform" warnings
2021-05-07 15:53:47 +00:00
)
}
}
shadowJar {
archiveBaseName.set(projectName)
archiveClassifier.set('')
archiveVersion.set('')
mergeServiceFiles() // Tell plugin to merge duplicate service files
}