2023-03-17 14:47:10 -04:00
|
|
|
plugins {
|
2024-11-21 12:07:57 -05:00
|
|
|
id 'com.netflix.nebula.ospackage' version '11.4.0'
|
|
|
|
id 'com.intershop.gradle.jaxb' version '5.1.0'
|
2023-03-17 14:47:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Get version from main project gradle
|
|
|
|
def packVersion = properties.get("packageVersion");
|
|
|
|
def jarVersion = properties.get("jarVersion");
|
|
|
|
|
2020-01-06 16:14:04 -05:00
|
|
|
dependencies {
|
2024-11-21 12:07:57 -05:00
|
|
|
implementation project(':HIRS_Utils')
|
|
|
|
|
|
|
|
implementation libs.bouncycastle
|
2024-11-22 10:58:20 -05:00
|
|
|
implementation libs.commons.codec
|
|
|
|
implementation libs.glassfish.jakarta.json
|
2024-11-21 12:07:57 -05:00
|
|
|
implementation libs.glassfish.jaxb.runtime
|
2024-11-22 10:58:20 -05:00
|
|
|
implementation libs.hibernate.core
|
2024-11-21 12:07:57 -05:00
|
|
|
implementation libs.jcommander
|
2024-11-22 10:58:20 -05:00
|
|
|
implementation libs.jackson.databind
|
2024-11-21 12:07:57 -05:00
|
|
|
implementation libs.jakarta.persistence.api
|
|
|
|
implementation libs.jakarta.xml
|
|
|
|
implementation libs.log4j.core
|
|
|
|
|
|
|
|
compileOnly libs.lombok
|
2023-11-01 10:03:34 -04:00
|
|
|
annotationProcessor libs.lombok
|
|
|
|
|
2023-03-17 14:47:10 -04:00
|
|
|
testImplementation libs.testng
|
2024-11-22 10:58:20 -05:00
|
|
|
|
|
|
|
testCompileOnly libs.lombok
|
|
|
|
testAnnotationProcessor libs.lombok
|
|
|
|
|
2020-01-06 16:14:04 -05:00
|
|
|
}
|
2022-08-26 01:29:01 -04:00
|
|
|
test {
|
2024-11-21 12:07:57 -05:00
|
|
|
testLogging.showStandardStreams true
|
2022-08-26 01:29:01 -04:00
|
|
|
}
|
|
|
|
|
2020-01-06 16:14:04 -05:00
|
|
|
jar {
|
2023-03-17 14:47:10 -04:00
|
|
|
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF'
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
2024-11-21 12:07:57 -05:00
|
|
|
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
|
2020-01-06 16:14:04 -05:00
|
|
|
}
|
|
|
|
|
2023-03-17 14:47:10 -04:00
|
|
|
ospackage {
|
|
|
|
packageName = 'tcg-rim-tool'
|
|
|
|
os = LINUX
|
|
|
|
arch = NOARCH
|
|
|
|
version = "$packVersion"
|
|
|
|
release = '1'
|
|
|
|
|
|
|
|
user 'root'
|
|
|
|
fileMode = 0755
|
|
|
|
|
2024-11-21 12:07:57 -05:00
|
|
|
into('/opt/rimtool/lib') {
|
2023-03-17 14:47:10 -04:00
|
|
|
from jar.outputs.files
|
|
|
|
from configurations.runtimeClasspath
|
|
|
|
from 'libs'
|
|
|
|
}
|
|
|
|
|
2024-11-21 12:07:57 -05:00
|
|
|
into('/opt/rimtool/scripts') {
|
|
|
|
from('scripts') {
|
|
|
|
exclude {
|
|
|
|
FileTreeElement details ->
|
|
|
|
details.file.name.endsWith('.bat')
|
|
|
|
}
|
2023-03-17 14:47:10 -04:00
|
|
|
}
|
2024-11-21 12:07:57 -05:00
|
|
|
}
|
|
|
|
into('/opt/rimtool/docs') {
|
|
|
|
from('./') {
|
|
|
|
include {
|
|
|
|
FileTreeElement details ->
|
|
|
|
details.file.name.endsWith('.md')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
into('/opt/rimtool/data') {
|
|
|
|
from('src/test/resources/') {
|
|
|
|
}
|
|
|
|
}
|
2024-01-16 18:28:40 -05: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'
|
2023-03-17 14:47:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
buildRpm {
|
2024-11-21 12:07:57 -05:00
|
|
|
arch = X86_64
|
2020-01-06 16:14:04 -05:00
|
|
|
}
|
2023-03-17 14:47:10 -04:00
|
|
|
|
|
|
|
buildDeb {
|
|
|
|
arch = 'amd64'
|
|
|
|
}
|
2024-07-15 15:05:31 -04:00
|
|
|
|
2024-11-21 12:07:57 -05:00
|
|
|
task buildZip(type: Zip) {
|
2024-07-17 14:27:26 -04:00
|
|
|
dependsOn jar
|
2024-07-15 15:05:31 -04:00
|
|
|
dependsOn jar
|
2024-11-21 12:07:57 -05:00
|
|
|
from(tasks.jar.archiveFile) {
|
|
|
|
rename(filename ->
|
2024-07-17 14:27:26 -04:00
|
|
|
"${project.name}.jar")
|
2024-07-15 15:05:31 -04:00
|
|
|
into '/'
|
|
|
|
}
|
2024-11-21 12:07:57 -05:00
|
|
|
from('./build/resources/test/rim_fields.json') {
|
2024-07-15 15:05:31 -04:00
|
|
|
into '/'
|
|
|
|
}
|
2024-11-21 12:07:57 -05:00
|
|
|
from('../../.ci/tcg-rim-tool/configs/Base_Rim_Config.json') {
|
2024-07-16 15:57:33 -04:00
|
|
|
into '/'
|
|
|
|
}
|
2024-11-21 12:07:57 -05:00
|
|
|
from('../../.ci/tcg-rim-tool/eventlogs/TpmLog.bin') {
|
2024-07-16 15:57:33 -04:00
|
|
|
into '/'
|
|
|
|
}
|
2024-11-21 12:07:57 -05:00
|
|
|
from('../../.ci/tcg-rim-tool/keys/PC_OEM1_rim_signer_rsa_3k_sha384.key') {
|
2024-07-16 15:57:33 -04:00
|
|
|
into '/'
|
|
|
|
}
|
2024-11-21 12:07:57 -05:00
|
|
|
from('../../.ci/tcg-rim-tool/certs/PC_OEM1_rim_signer_rsa_3k_sha384.pem') {
|
2024-07-16 15:57:33 -04:00
|
|
|
into '/'
|
|
|
|
}
|
2024-11-21 12:07:57 -05:00
|
|
|
from('../../.ci/tcg-rim-tool/certs/PC_OEM1_Cert_Chain.pem') {
|
2024-07-16 15:57:33 -04:00
|
|
|
into '/'
|
|
|
|
}
|
2024-07-16 11:48:59 -04:00
|
|
|
|
|
|
|
archiveBaseName.set(project.name)
|
2024-07-15 15:05:31 -04:00
|
|
|
destinationDirectory.set(file("$buildDir/distributions"))
|
2024-07-17 14:27:26 -04:00
|
|
|
archiveFileName.set("${project.name}.zip")
|
2024-07-15 15:05:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
buildZip.dependsOn jar
|
|
|
|
//build.dependsOn buildZip
|