Skip to content

Ghidra is a software reverse engineering (SRE) framework

Make cabextract build incremental.

Jimbo Whalesca24cd52e50d
diff --git a/GPL/CabExtract/build.gradle b/GPL/CabExtract/build.gradle
index bed87fbf34..1c8d50c803 100644
--- a/GPL/CabExtract/build.gradle
+++ b/GPL/CabExtract/build.gradle
@@ -14,44 +14,6 @@ eclipse.project.name = 'GPL CabExtract'
project.ext.cabextract = "cabextract-1.6"
-/*********************************************************************************
- * CabExtract extraction task
- *
- * Unpacks the cabextract tar file that's needed for the symbol server. This
- * is only unpacked for building the tool; once it's built, this unzipped
- * archive is removed.
- *********************************************************************************/
-task unpackCabExtract (type: Copy) {
-
- from tarTree(file("data/${cabextract}.tar.gz"))
- into 'build/unpack'
-
- // Force the task to be executed every time by setting to false.
- // This is done since configure changes the contents for a platform
- // NOTE: this can cause the 'build/unpack' to be deleted prior to an unpack
- outputs.upToDateWhen { false }
-
- doLast {
- // Force all unpacked files to have the same timestamp
- ant.touch() {
- fileset(dir: file("build/unpack/${cabextract}"))
- }
- }
-}
-
-/*********************************************************************************
- * CabExtract configure task
- *
- * Performs configure on a newly unpacked cabextract tar file prior to
- * performing make.
- *********************************************************************************/
-task configureCabExtract (type: Exec) {
- group "private"
- workingDir "build/unpack/${cabextract}"
- executable "./configure"
- dependsOn unpackCabExtract
-}
-
/*********************************************************************************
* CabExtract platform specific tasks
*
@@ -66,12 +28,27 @@ if (['linux64', 'osx64'].contains(currentPlatform)) {
group "private"
workingDir "build/unpack/${cabextract}"
executable "make"
- dependsOn configureCabExtract
- doLast {
+ inputs.file("data/${cabextract}.tar.gz")
+ outputs.file("build/os/${currentPlatform}/cabextract")
+ // Extract archive and ./configure
+ doFirst {
copy {
- from "build/unpack/${cabextract}/cabextract"
- into "build/os/${currentPlatform}"
+ 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 {
+ ant.move file: "build/unpack/${cabextract}/cabextract",
+ todir: "build/os/${currentPlatform}"
delete file("build/unpack/${cabextract}")
}
}