diff --git a/HIRS_AttestationCA/build.gradle b/HIRS_AttestationCA/build.gradle index fc3bcc0eb..bc573291f 100644 --- a/HIRS_AttestationCA/build.gradle +++ b/HIRS_AttestationCA/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'io.spring.dependency-management' version '1.1.0' id 'com.google.protobuf' version '0.9.4' - id 'checkstyle' version '10.12.7' + id 'checkstyle' } java { @@ -59,6 +59,7 @@ dependencies { annotationProcessor libs.lombok } checkstyle { + toolVersion = '10.12.7' configFile file("${rootDir}/config/checkstyle/checkstyle.xml") } checkstyleMain { diff --git a/HIRS_AttestationCAPortal/build.gradle b/HIRS_AttestationCAPortal/build.gradle index 9a15645ce..b06df5af0 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,23 @@ dependencies { testImplementation 'org.hsqldb:hsqldb' } +checkstyle { + toolVersion = '10.12.7' + configFile file("${rootDir}/config/checkstyle/checkstyle.xml") +} +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_AttestationCAPortal/config/checkstyle/suppressions.xml b/HIRS_AttestationCAPortal/config/checkstyle/suppressions.xml index ec0b37b09..9eb708323 100644 --- a/HIRS_AttestationCAPortal/config/checkstyle/suppressions.xml +++ b/HIRS_AttestationCAPortal/config/checkstyle/suppressions.xml @@ -6,4 +6,6 @@ + + diff --git a/HIRS_Structs/build.gradle b/HIRS_Structs/build.gradle index 894a27941..c5755d7c6 100644 --- a/HIRS_Structs/build.gradle +++ b/HIRS_Structs/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' -// id 'checkstyle' + id 'checkstyle' } java { @@ -22,17 +22,23 @@ dependencies { testImplementation libs.testng } -//ext.configDir = new File(projectDir, 'config') -//ext.checkstyleConfigDir = "$configDir/checkstyle" +checkstyle { + toolVersion = '10.12.7' + configFile file("${rootDir}/config/checkstyle/checkstyle.xml") +} +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_Structs/config/checkstyle/suppressions.xml b/HIRS_Structs/config/checkstyle/suppressions.xml index ec0b37b09..9eb708323 100644 --- a/HIRS_Structs/config/checkstyle/suppressions.xml +++ b/HIRS_Structs/config/checkstyle/suppressions.xml @@ -6,4 +6,6 @@ + + diff --git a/HIRS_Utils/build.gradle b/HIRS_Utils/build.gradle index 366c27b94..be4d48ffd 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,23 @@ dependencies { } +checkstyle { + toolVersion = '10.12.7' + configFile file("${rootDir}/config/checkstyle/checkstyle.xml") +} +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/build.gradle b/build.gradle index 27df717e9..801c4909f 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,6 @@ plugins { subprojects { apply plugin: "com.github.spotbugs" - //apply plugin: 'checkstyle' spotbugs { excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')