mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-21 05:53:27 +00:00
40 lines
1.0 KiB
Groovy
40 lines
1.0 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'
|
|
}
|
|
|
|
// Global checkstyle file
|
|
ext.checkstyleConfigFile = new File(rootDir, "/config/checkstyle/sun_checks.xml")
|
|
|
|
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"
|
|
|