From 17bd7d90216194afa1cc5910f494e414c909ce13 Mon Sep 17 00:00:00 2001
From: Cyrus <24922493+cyrus-dev@users.noreply.github.com>
Date: Fri, 2 Feb 2024 08:07:08 -0500
Subject: [PATCH] New branch because there seemed to be issues with the
previous branch merges.
---
HIRS_AttestationCA/build.gradle | 24 ++-
.../config/checkstyle/suppressions.xml | 15 ++
HIRS_AttestationCAPortal/build.gradle | 24 +++
HIRS_Structs/build.gradle | 34 +++-
HIRS_Utils/build.gradle | 24 +++
HIRS_Utils/config/checkstyle/suppressions.xml | 11 +
config/checkstyle/checkstyle.xml | 192 ++++++++++++++++++
config/checkstyle/sun_checks.xml | 138 ++++++-------
config/checkstyle/suppressions.xml | 15 ++
settings.gradle | 1 +
tools/tcg_eventlog_tool/build.gradle | 21 ++
tools/tcg_rim_tool/build.gradle | 21 ++
12 files changed, 437 insertions(+), 83 deletions(-)
create mode 100644 HIRS_AttestationCA/config/checkstyle/suppressions.xml
create mode 100644 HIRS_Utils/config/checkstyle/suppressions.xml
create mode 100644 config/checkstyle/checkstyle.xml
create mode 100644 config/checkstyle/suppressions.xml
diff --git a/HIRS_AttestationCA/build.gradle b/HIRS_AttestationCA/build.gradle
index 30f6e415..e1cd78ba 100644
--- a/HIRS_AttestationCA/build.gradle
+++ b/HIRS_AttestationCA/build.gradle
@@ -2,6 +2,7 @@ plugins {
id 'java'
id 'io.spring.dependency-management' version '1.1.0'
id 'com.google.protobuf' version '0.9.4'
+ id 'checkstyle'
}
java {
@@ -57,7 +58,28 @@ dependencies {
implementation libs.lombok
annotationProcessor libs.lombok
}
-
+checkstyle {
+ toolVersion = '10.12.7'
+ configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
+}
+// https://github.com/checkstyle/checkstyle/issues/14211#issuecomment-1884129948
+configurations.checkstyle {
+ resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
+ select("com.google.guava:guava:0")
+ }
+}
+checkstyleMain {
+ source ='src/main/java'
+}
+checkstyleTest {
+ source ='src/test/java'
+}
+tasks.withType(Checkstyle) {
+ reports {
+ xml.required = false
+ html.required = true
+ }
+}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.24.3'
diff --git a/HIRS_AttestationCA/config/checkstyle/suppressions.xml b/HIRS_AttestationCA/config/checkstyle/suppressions.xml
new file mode 100644
index 00000000..a726ee23
--- /dev/null
+++ b/HIRS_AttestationCA/config/checkstyle/suppressions.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HIRS_AttestationCAPortal/build.gradle b/HIRS_AttestationCAPortal/build.gradle
index 9a15645c..d233e301 100644
--- a/HIRS_AttestationCAPortal/build.gradle
+++ b/HIRS_AttestationCAPortal/build.gradle
@@ -5,6 +5,7 @@ plugins {
id 'com.netflix.nebula.ospackage' version '11.4.0'
id 'org.springframework.boot' version '3.0.6'
id 'io.spring.dependency-management' version '1.1.0'
+ id 'checkstyle'
}
// Get version from main project gradle
@@ -59,6 +60,29 @@ dependencies {
testImplementation 'org.hsqldb:hsqldb'
}
+checkstyle {
+ toolVersion = '10.12.7'
+ configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
+}
+// https://github.com/checkstyle/checkstyle/issues/14211#issuecomment-1884129948
+configurations.checkstyle {
+ resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
+ select("com.google.guava:guava:0")
+ }
+}
+checkstyleMain {
+ source ='src/main/java'
+}
+checkstyleTest {
+ source ='src/test/java'
+}
+tasks.withType(Checkstyle) {
+ reports {
+ xml.required = false
+ html.required = true
+ }
+}
+
test {
useJUnitPlatform()
}
diff --git a/HIRS_Structs/build.gradle b/HIRS_Structs/build.gradle
index ef56dcc8..087653ea 100644
--- a/HIRS_Structs/build.gradle
+++ b/HIRS_Structs/build.gradle
@@ -1,6 +1,6 @@
plugins {
id 'java'
-// id 'checkstyle'
+ id 'checkstyle'
}
java {
@@ -28,17 +28,29 @@ test {
useJUnitPlatform()
}
-//ext.configDir = new File(projectDir, 'config')
-//ext.checkstyleConfigDir = "$configDir/checkstyle"
+checkstyle {
+ toolVersion = '10.12.7'
+ configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
+}
+// https://github.com/checkstyle/checkstyle/issues/14211#issuecomment-1884129948
+configurations.checkstyle {
+ resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
+ select("com.google.guava:guava:0")
+ }
+}
+checkstyleMain {
+ source ='src/main/java'
+}
+checkstyleTest {
+ source ='src/test/java'
+}
+tasks.withType(Checkstyle) {
+ reports {
+ xml.required = false
+ html.required = true
+ }
+}
-//checkstyle {
-// toolVersion = '5.7'
-// configFile = checkstyleConfigFile
-// configProperties.put('basedir', checkstyleConfigDir)
-// ignoreFailures = false
-// showViolations = true
-//}
-//
//publishing {
// publications {
// maven(MavenPublication) {
diff --git a/HIRS_Utils/build.gradle b/HIRS_Utils/build.gradle
index 366c27b9..100af334 100644
--- a/HIRS_Utils/build.gradle
+++ b/HIRS_Utils/build.gradle
@@ -1,5 +1,6 @@
plugins {
id 'java'
+ id 'checkstyle'
}
// Get version from main project gradle
def packVersion = properties.get("packageVersion");
@@ -54,6 +55,29 @@ dependencies {
}
+checkstyle {
+ toolVersion = '10.12.7'
+ configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
+}
+// https://github.com/checkstyle/checkstyle/issues/14211#issuecomment-1884129948
+configurations.checkstyle {
+ resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
+ select("com.google.guava:guava:0")
+ }
+}
+checkstyleMain {
+ source ='src/main/java'
+}
+checkstyleTest {
+ source ='src/test/java'
+}
+tasks.withType(Checkstyle) {
+ reports {
+ xml.required = false
+ html.required = true
+ }
+}
+
test {
useJUnitPlatform()
}
diff --git a/HIRS_Utils/config/checkstyle/suppressions.xml b/HIRS_Utils/config/checkstyle/suppressions.xml
new file mode 100644
index 00000000..9eb70832
--- /dev/null
+++ b/HIRS_Utils/config/checkstyle/suppressions.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
new file mode 100644
index 00000000..8bc24a3c
--- /dev/null
+++ b/config/checkstyle/checkstyle.xml
@@ -0,0 +1,192 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/checkstyle/sun_checks.xml b/config/checkstyle/sun_checks.xml
index 61d5ad0c..758e36d3 100644
--- a/config/checkstyle/sun_checks.xml
+++ b/config/checkstyle/sun_checks.xml
@@ -1,77 +1,94 @@
+ "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
+ "https://checkstyle.org/dtds/configuration_1_3.dtd">
-
+
-
-
+
+ -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
+
+
-
+
-
+
-
+
-
+
+
+
+
-
+
-
+
-
-
-
-
+
+
+
+
-
+
@@ -79,25 +96,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
+
-
+
@@ -108,29 +117,22 @@
-
-
+
-
-
+
+
+
-
-
-
-
+
-
-
-
-
-
+
-
+
@@ -142,48 +144,42 @@
-
-
+
-
-
+
-
-
-
+
-
-
-
+
-
+
-
+
+
-
-
+
diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml
new file mode 100644
index 00000000..a726ee23
--- /dev/null
+++ b/config/checkstyle/suppressions.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index 44f38ec3..b67eb0b6 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -12,6 +12,7 @@ dependencyResolutionManagement {
libs {
version('springboot', '3.0.1')
version('jackson', '2.14.2')
+ library('checkstyle', 'com.puppycrawl.tools:checkstyle:10.12.7')
library('commons-codec', 'commons-codec:commons-codec:1.15')
library('commons_io', 'commons-io:commons-io:2.11.0')
library('commons-lang3', 'org.apache.commons:commons-lang3:3.13.0')
diff --git a/tools/tcg_eventlog_tool/build.gradle b/tools/tcg_eventlog_tool/build.gradle
index f9432773..f47671b9 100644
--- a/tools/tcg_eventlog_tool/build.gradle
+++ b/tools/tcg_eventlog_tool/build.gradle
@@ -2,6 +2,7 @@ import java.util.concurrent.TimeUnit
plugins {
id "java"
id "com.netflix.nebula.ospackage" version "11.4.0"
+ id 'checkstyle'
}
// Get version from main project gradle
def packVersion = properties.get("packageVersion");
@@ -26,6 +27,26 @@ dependencies {
ext.configDir = new File(projectDir, 'config')
+checkstyle {
+ toolVersion = '10.12.7'
+ configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
+}
+// https://github.com/checkstyle/checkstyle/issues/14211#issuecomment-1884129948
+configurations.checkstyle {
+ resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
+ select("com.google.guava:guava:0")
+ }
+}
+checkstyleMain {
+ source ='src/main/java'
+}
+tasks.withType(Checkstyle) {
+ reports {
+ xml.required = false
+ html.required = true
+ }
+}
+
jar {
// Keep jar clean:
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF'
diff --git a/tools/tcg_rim_tool/build.gradle b/tools/tcg_rim_tool/build.gradle
index bfd32ba3..fc39524c 100644
--- a/tools/tcg_rim_tool/build.gradle
+++ b/tools/tcg_rim_tool/build.gradle
@@ -2,6 +2,7 @@ plugins {
id "java"
id 'com.netflix.nebula.ospackage' version '11.4.0'
id 'com.intershop.gradle.jaxb' version '5.1.0'
+ id 'checkstyle'
}
// Get version from main project gradle
@@ -44,6 +45,26 @@ test {
testLogging.showStandardStreams true
}
+checkstyle {
+ toolVersion = '10.12.7'
+ configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
+}
+// https://github.com/checkstyle/checkstyle/issues/14211#issuecomment-1884129948
+configurations.checkstyle {
+ resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
+ select("com.google.guava:guava:0")
+ }
+}
+checkstyleMain {
+ source ='src/main/java'
+}
+tasks.withType(Checkstyle) {
+ reports {
+ xml.required = false
+ html.required = true
+ }
+}
+
jar {
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE