2020-05-27 21:31:15 +00:00
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'findbugs'
|
|
|
|
apply plugin: 'checkstyle'
|
2020-05-29 21:20:06 +00:00
|
|
|
apply plugin: 'nebula.ospackage'
|
2020-05-27 21:31:15 +00:00
|
|
|
|
|
|
|
version = '1.0'
|
|
|
|
|
|
|
|
repositories {
|
2020-11-09 18:04:11 +00:00
|
|
|
mavenCentral()
|
2020-05-27 21:31:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':HIRS_Utils')
|
|
|
|
compile libs.jcommander
|
2020-05-29 21:20:06 +00:00
|
|
|
compile libs.commons_io
|
2020-05-27 21:31:15 +00:00
|
|
|
compileOnly libs.checkstyle
|
|
|
|
compileOnly libs.findbugs
|
|
|
|
testCompile libs.testng
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.configDir = new File(projectDir, 'config')
|
|
|
|
ext.checkstyleConfigDir = "$configDir/checkstyle"
|
|
|
|
checkstyle {
|
2023-07-25 19:19:57 +00:00
|
|
|
toolVersion = '8.45.1'
|
2020-05-27 21:31:15 +00:00
|
|
|
configFile = checkstyleConfigFile
|
|
|
|
configProperties.put('basedir', checkstyleConfigDir)
|
|
|
|
ignoreFailures = false
|
|
|
|
showViolations = true
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.findbugsConfigDir = "$configDir/findbugs"
|
|
|
|
|
|
|
|
findbugs {
|
|
|
|
toolVersion = '3.0.0'
|
|
|
|
ignoreFailures = false
|
|
|
|
effort = 'max'
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
2020-11-09 18:04:11 +00:00
|
|
|
manifest {
|
|
|
|
attributes("Main-Class": "hirs.tcg_eventlog.Main",
|
|
|
|
"Class-Path": configurations.runtime.files.collect { "lib/$it.name" }.join(' ')
|
|
|
|
)
|
|
|
|
}
|
|
|
|
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {}
|
|
|
|
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
|
2020-05-27 21:31:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uploadArchives {
|
2020-11-09 18:04:11 +00:00
|
|
|
repositories {
|
|
|
|
flatDir {
|
|
|
|
dirs "${buildDir}"
|
|
|
|
}
|
|
|
|
}
|
2020-05-27 21:31:15 +00:00
|
|
|
}
|
2020-05-29 21:20:06 +00:00
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
classpath 'com.netflix.nebula:gradle-ospackage-plugin:4.9.3'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Produce packages
|
|
|
|
ospackage {
|
2022-05-03 19:57:54 +00:00
|
|
|
def gitCommitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim()
|
2020-11-09 18:04:11 +00:00
|
|
|
packageName = 'tcg_eventlog_tool'
|
|
|
|
os = LINUX
|
2022-05-03 19:57:54 +00:00
|
|
|
arch = X86_64
|
2021-08-02 14:08:33 +00:00
|
|
|
version = '2.1.0'
|
2022-05-03 19:57:54 +00:00
|
|
|
release = gitCommitHash
|
2020-05-29 21:20:06 +00:00
|
|
|
|
|
|
|
into '/opt/hirs/eventlog'
|
|
|
|
user 'root'
|
2020-11-09 18:04:11 +00:00
|
|
|
fileMode = 0755
|
2020-05-29 21:20:06 +00:00
|
|
|
|
|
|
|
from(jar.outputs.files) {
|
|
|
|
into 'lib'
|
|
|
|
}
|
|
|
|
from('lib') {
|
|
|
|
into 'lib'
|
|
|
|
}
|
|
|
|
from(configurations.runtime) {
|
|
|
|
into 'lib'
|
|
|
|
}
|
|
|
|
from('scripts') {
|
|
|
|
exclude {
|
|
|
|
FileTreeElement details ->
|
2020-11-09 18:04:11 +00:00
|
|
|
details.file.name.endsWith('.bat')
|
2020-05-29 21:20:06 +00:00
|
|
|
}
|
|
|
|
into 'scripts'
|
|
|
|
}
|
|
|
|
from('docs') {
|
|
|
|
exclude {
|
|
|
|
FileTreeElement details ->
|
2020-11-09 18:04:11 +00:00
|
|
|
details.file.name.endsWith('.odt')
|
2020-05-29 21:20:06 +00:00
|
|
|
}
|
|
|
|
into 'docs'
|
|
|
|
}
|
|
|
|
from('./') {
|
|
|
|
include {
|
|
|
|
FileTreeElement details ->
|
2020-11-09 18:04:11 +00:00
|
|
|
details.file.name.endsWith('.md')
|
2020-05-29 21:20:06 +00:00
|
|
|
}
|
|
|
|
into './'
|
2022-05-03 19:57:54 +00:00
|
|
|
link("/usr/bin/elt", "/opt/hirs/eventlog/scripts/eventlog.sh", 0x755)
|
2020-11-09 18:04:11 +00:00
|
|
|
}
|
|
|
|
|
2021-11-09 13:32:04 +00:00
|
|
|
into('/tmp/') {
|
2020-11-09 18:04:11 +00:00
|
|
|
fileMode 0664
|
|
|
|
from ('../../HIRS_Utils/src/main/resources/vendor-table.json') {
|
|
|
|
addParentDirs true
|
|
|
|
createDirectoryEntry true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-09 13:32:04 +00:00
|
|
|
postInstall file('scripts/vendor-table.sh')
|
|
|
|
|
2020-11-09 18:04:11 +00:00
|
|
|
buildRpm {
|
2022-05-03 19:57:54 +00:00
|
|
|
arch = X86_64
|
2020-11-09 18:04:11 +00:00
|
|
|
}
|
|
|
|
buildDeb {
|
2022-05-03 19:57:54 +00:00
|
|
|
arch = X86_64
|
2020-05-29 21:20:06 +00:00
|
|
|
}
|
2021-08-02 14:08:33 +00:00
|
|
|
}
|