2022-11-09 20:31:00 +00:00
|
|
|
import java.util.concurrent.TimeUnit
|
2022-11-18 18:03:24 +00:00
|
|
|
import org.gradle.api.tasks.Copy
|
2022-11-09 20:31:00 +00:00
|
|
|
|
2022-10-31 20:46:06 +00:00
|
|
|
plugins {
|
|
|
|
// Apply the application plugin to add support for building a CLI application in Java.
|
|
|
|
id 'application'
|
2022-11-18 18:03:24 +00:00
|
|
|
id 'java'
|
|
|
|
id 'war'
|
|
|
|
id "nebula.ospackage" version "9.1.1"
|
2022-10-31 20:46:06 +00:00
|
|
|
}
|
2018-09-06 13:47:33 +00:00
|
|
|
|
2022-10-31 20:46:06 +00:00
|
|
|
// Global checkstyle file
|
|
|
|
ext.checkstyleConfigFile = new File(rootDir, "/config/checkstyle/sun_checks.xml")
|
2018-09-06 13:47:33 +00:00
|
|
|
|
2022-10-31 20:46:06 +00:00
|
|
|
dependencies {
|
|
|
|
repositories {
|
|
|
|
// Use Maven Central for resolving dependencies.
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-09 20:31:00 +00:00
|
|
|
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"
|
2022-11-18 18:03:24 +00:00
|
|
|
|
|
|
|
task buildAcaRpm(type:Exec) {
|
|
|
|
description 'Builds a RPM package for the HIRS ACA'
|
|
|
|
def rpmName="build/distributions/HIRS_AttesationCA-${projectVersion}.${buildTime}.${gitHash}.el8-1.x86_64.rpm created"
|
|
|
|
doFirst {
|
|
|
|
println "Building HIRS_AttestationCA.war, HIRS_AttestationCAPortal.war, and HIRS_AttestationCA.rpm"
|
|
|
|
commandLine './package/package.rocky.sh'
|
|
|
|
}
|
|
|
|
doLast {
|
|
|
|
println "Build complete"
|
|
|
|
println "${rpmName} created"
|
|
|
|
}
|
|
|
|
}
|