HIRS/tools/tcg_rim_tool/build.gradle

113 lines
2.5 KiB
Groovy
Raw Normal View History

plugins {
id "java"
id 'com.netflix.nebula.ospackage' version '11.4.0'
id 'com.intershop.gradle.jaxb' version '5.1.0'
}
// Get version from main project gradle
def packVersion = properties.get("packageVersion");
def jarVersion = properties.get("jarVersion");
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
flatDir { dirs "lib" }
}
dependencies {
implementation project(':HIRS_Utils')
implementation libs.bouncycastle
implementation libs.glassfish.json
implementation libs.glassfish.jaxb.runtime
implementation libs.jcommander
implementation libs.jakarta.api
implementation libs.jakarta.xml
implementation libs.commons.codec
implementation libs.hibernate.core
implementation libs.jackson.databind
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
implementation libs.guava
compileOnly libs.lombok
implementation libs.lombok
annotationProcessor libs.lombok
testImplementation libs.testng
}
2022-08-26 05:29:01 +00:00
test {
testLogging.showStandardStreams true
}
jar {
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes "Main-Class": "hirs.swid.Main"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
//jar name format: [archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]
archiveVersion = jarVersion
}
ospackage {
packageName = 'tcg-rim-tool'
os = LINUX
arch = NOARCH
version = "$packVersion"
release = '1'
user 'root'
fileMode = 0755
2024-01-16 23:28:40 +00:00
into ('/opt/rimtool/lib') {
from jar.outputs.files
from configurations.runtimeClasspath
from 'libs'
}
2024-01-16 23:28:40 +00:00
into ('/opt/rimtool/scripts') {
from ('scripts') {
exclude {
FileTreeElement details ->
details.file.name.endsWith('.bat')
}
}
}
2024-01-16 23:28:40 +00:00
into ('/opt/rimtool/docs') {
from('./') {
include {
FileTreeElement details ->
details.file.name.endsWith('.md')
}
}
}
2024-01-16 23:28:40 +00:00
into ('/opt/rimtool/data') {
from('src/test/resources/') {
}
}
2024-01-16 23:28:40 +00:00
link("/usr/local/bin/rim", "/opt/rimtool/scripts/rimtool.sh", 0x755)
// Post Install
postInstall "echo ${jarVersion} > /opt/rimtool/VERSION"
// Post Uninstall
postUninstall 'rm -rf /opt/rimtool'
}
buildRpm {
arch = X86_64
}
buildDeb {
arch = 'amd64'
}