ghidra/GPL/CabExtract/build.gradle
2020-03-11 16:46:42 -04:00

60 lines
1.7 KiB
Groovy

apply from: file("../gpl.gradle").getCanonicalPath()
if (findProject(':Generic') != null) {
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGPLModule.gradle"
}
else {
apply from: "../nativeBuildProperties.gradle"
}
apply plugin: 'eclipse'
eclipse.project.name = 'GPL CabExtract'
project.ext.cabextract = "cabextract-1.6"
/*********************************************************************************
* CabExtract platform specific tasks
*
* The cabextract tool requires that its 'configure' script is called before make.
*********************************************************************************/
def currentPlatform = getCurrentPlatformName()
if (['linux64', 'osx64'].contains(currentPlatform)) {
def makeName = "${currentPlatform}CabExtractMake"
task (makeName, type: Exec) {
group "private"
workingDir "build/unpack/${cabextract}"
executable "make"
// Specify output so cabextract is only built if this is missing
outputs.file("build/os/${currentPlatform}/cabextract")
// Extract archive and ./configure
doFirst {
copy {
from tarTree(file("data/${cabextract}.tar.gz"))
into 'build/unpack'
}
// Force all unpacked files to have the same timestamp
ant.touch() {
fileset(dir: file("build/unpack/${cabextract}"))
}
exec {
workingDir "build/unpack/${cabextract}"
executable "./configure"
}
}
// Move out the built cabextract and delete the extracted files
doLast {
copy {
from "build/unpack/${cabextract}/cabextract"
into "build/os/${currentPlatform}"
}
delete file("build/unpack/${cabextract}")
}
}
}