HIRS/build.gradle

37 lines
966 B
Groovy
Raw Normal View History

import java.util.concurrent.TimeUnit
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
}
2018-09-06 13:47:33 +00:00
// Global checkstyle file
ext.checkstyleConfigFile = new File(rootDir, "/config/checkstyle/sun_checks.xml")
2018-09-06 13:47:33 +00:00
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 gitProcess = 'git rev-parse --short HEAD'.execute();
gitProcess.waitFor();
def shortHash = gitProcess.text.trim();
def gitHash = shortHash.substring(0, shortHash.length() - 2);
return gitHash;
}
project.ext["packageVersion"] = "${projectVersion}.${buildTime}.${gitHash}.el8"