HIRS/build.gradle
Cyrus 4a9c579822 This is the first step for adding spotbugs (formerly findbugs) back into
the build.  The configuration is in place but the majority of the
projects are being excluded.  The eventlog (a small sample size) is
however being run with the proper corrections commited.
2023-12-20 12:55:50 -05:00

57 lines
1.4 KiB
Groovy

import java.util.concurrent.TimeUnit
import org.gradle.api.tasks.Copy
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id 'com.github.spotbugs' version '6.0.4' apply false
}
// Global checkstyle file
ext.checkstyleConfigFile = new File(rootDir, "/config/checkstyle/sun_checks.xml")
subprojects {
apply plugin: "com.github.spotbugs"
spotbugs {
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')
}
tasks.withType(com.github.spotsbugs.snom.SpotBugsTask) {
reports {
html {
enabled = 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["jarVersion"] = "${projectVersion}.${buildTime}.${gitHash}"
project.ext["packageVersion"] = "${projectVersion}.${buildTime}.${gitHash}.el8"