From ed5bf6f17a2b9ca17d71cd6a9dbee4554a2dd87e Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Fri, 4 Nov 2022 12:08:28 -0400 Subject: [PATCH] added tcg_event_log tool build with rpm packaging [skip ci] --- settings.gradle | 1 + tools/tcg_eventlog_tool/build.gradle | 67 ++++++--------------- tools/tcg_eventlog_tool/scripts/eventlog.sh | 2 +- 3 files changed, 19 insertions(+), 51 deletions(-) diff --git a/settings.gradle b/settings.gradle index 149098a6..dd42c72c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,6 +3,7 @@ include ':HIRS_Utils' include ':HIRS_Structs' include ':TPM_Utils' include ':HIRS_AttestationCA' +include ':tools:tcg_eventlog_tool' dependencyResolutionManagement { versionCatalogs { diff --git a/tools/tcg_eventlog_tool/build.gradle b/tools/tcg_eventlog_tool/build.gradle index c7dce931..e9f1345f 100644 --- a/tools/tcg_eventlog_tool/build.gradle +++ b/tools/tcg_eventlog_tool/build.gradle @@ -1,8 +1,7 @@ -apply plugin: 'java' -apply plugin: 'findbugs' -apply plugin: 'checkstyle' -apply plugin: 'nebula.ospackage' - +plugins { + id "java" + id "nebula.ospackage" version "9.1.1" +} version = '1.0' repositories { @@ -10,58 +9,26 @@ repositories { } dependencies { - compile project(':HIRS_Utils') - compile libs.jcommander - compile libs.commons_io - compileOnly libs.checkstyle - compileOnly libs.findbugs - testCompile libs.testng + implementation project(':HIRS_Utils') + implementation libs.jcommander + implementation libs.commons.io } ext.configDir = new File(projectDir, 'config') ext.checkstyleConfigDir = "$configDir/checkstyle" -checkstyle { - toolVersion = '5.7' - configFile = checkstyleConfigFile - configProperties.put('basedir', checkstyleConfigDir) - ignoreFailures = false - showViolations = true -} - ext.findbugsConfigDir = "$configDir/findbugs" -findbugs { - toolVersion = '3.0.0' - ignoreFailures = false - effort = 'max' -} - jar { - manifest { - attributes("Main-Class": "hirs.tcg_eventlog.Main", - "Class-Path": configurations.runtime.files.collect { "lib/$it.name" }.join(' ') - ) - } - from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {} - exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA' -} + // Keep jar clean: + exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF' -uploadArchives { - repositories { - flatDir { - dirs "${buildDir}" - } - } -} - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.netflix.nebula:gradle-ospackage-plugin:4.9.3' - } -} + manifest { + attributes( + 'Main-Class': 'hirs.tcg_eventlog.Main', + 'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' ') + ) + } + } // Produce packages ospackage { @@ -81,7 +48,7 @@ ospackage { from('lib') { into 'lib' } - from(configurations.runtime) { + from(configurations.runtimeClasspath) { into 'lib' } from('scripts') { diff --git a/tools/tcg_eventlog_tool/scripts/eventlog.sh b/tools/tcg_eventlog_tool/scripts/eventlog.sh index 8bd9aff4..1152fc4b 100755 --- a/tools/tcg_eventlog_tool/scripts/eventlog.sh +++ b/tools/tcg_eventlog_tool/scripts/eventlog.sh @@ -5,4 +5,4 @@ scriptDir=$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")") baseDir=${scriptDir%/*} libDir=$baseDir"/lib/" jar="tcg_eventlog_tool-1.0.jar"; -java -jar $libDir$jar "$@" \ No newline at end of file +java -jar $libDir$jar "$@"