HIRS/build.gradle
TheSilentCoder 9606b2abe0
Some checks failed
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (ubuntu-20.04) (push) Has been cancelled
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (windows-2022) (push) Has been cancelled
HIRS Build and Unit Test / ACA_Provisioner_Unit_Tests (push) Has been cancelled
HIRS System Tests / DockerTests (push) Has been cancelled
Dotnet Provisioner Unit Tests / Evaluate Tests (push) Has been cancelled
issue_887: Added OWASP plugin. First run took about 40 minutes. Subsequent runs took about 2-4 minutes. Plugin downloads the NVD (National Vulnerability Database) the very first time the user runs the analyzeDependency command (assuming said user does not already have it cached somewhereon their system. Once downloaded, the plugin checks the subprojects dependenies against that of the NVD's and creates an HTML report per subproject on all the critical dependencies subproject has.
2024-12-20 15:17:43 -05:00

94 lines
2.1 KiB
Groovy

import com.github.spotbugs.snom.SpotBugsTask
import java.util.concurrent.TimeUnit
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id 'checkstyle'
id 'com.github.spotbugs' version '6.0.13' apply false
id 'org.owasp.dependencycheck' version '11.1.1'
id 'java'
}
// Global checkstyle file
ext.checkstyleConfigFile = new File(rootDir, "/config/checkstyle/sun_checks.xml")
subprojects {
apply plugin: "com.github.spotbugs"
apply plugin: "java"
apply plugin: "checkstyle"
apply plugin: "org.owasp.dependencycheck"
repositories {
flatDir { dirs "lib" }
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
checkstyle {
toolVersion = '10.20.0'
configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
}
checkstyleMain {
source = 'src/main/java'
}
checkstyleTest {
source = 'src/test/java'
}
tasks.withType(Checkstyle).configureEach {
reports {
xml.required = false
html.required = true
}
}
spotbugs {
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')
}
tasks.withType(SpotBugsTask).configureEach {
reports {
html.required = true
}
}
}
dependencies {
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
}
def projectVersion = rootProject.file('VERSION').text.trim()
def buildTime = { ->
Date latestdate = new Date()
def time = latestdate.getTime()
long seconds = TimeUnit.MILLISECONDS.toSeconds(time)
return seconds
}
def gitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
project.ext["projVersion"] = "${projectVersion}"
project.ext["jarVersion"] = "${projectVersion}.${buildTime}.${gitHash}"
project.ext["packageVersion"] = "${projectVersion}.${buildTime}.${gitHash}.el8"