From d55e078cbe3b68b9b7de08a756ca43f52ac6d3e2 Mon Sep 17 00:00:00 2001 From: Mike Hunhoff Date: Wed, 11 Jan 2023 16:03:51 -0700 Subject: [PATCH] output GHIDRA_INSTALL_DIR during build; update documentation (#32) --- README.md | 1 + build.gradle | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 263f445..e7bad55 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Use the following steps to build Ghidrathon for your environment: * Download the latest Ghidrathon source release from [here](https://github.com/mandiant/Ghidrathon/releases) * Run the following command from the Ghidrathon source directory: * **Note:** Ghidrathon defaults to the Python binary found in your path. You can specify a different Python binary by adding the optional argument `-PPYTHON_BIN=` to the command below + * **Note:** you may optionally set an environment variable named `GHIDRA_INSTALL_DIR` instead of specifying `-PGHIDRA_INSTALL_DIR` ``` $ gradle -PGHIDRA_INSTALL_DIR= diff --git a/build.gradle b/build.gradle index 618e1e7..59b952f 100644 --- a/build.gradle +++ b/build.gradle @@ -58,12 +58,14 @@ tasks.matching { it.name != 'copyJepNativeBinaries' && it.name != 'installJep' } //----------------------START "DO NOT MODIFY" SECTION------------------------------ def ghidraInstallDir -if (System.env.GHIDRA_INSTALL_DIR) { - ghidraInstallDir = System.env.GHIDRA_INSTALL_DIR -} -else if (project.hasProperty("GHIDRA_INSTALL_DIR")) { +if (project.hasProperty("GHIDRA_INSTALL_DIR")) { ghidraInstallDir = project.getProperty("GHIDRA_INSTALL_DIR") } +else if (System.env.GHIDRA_INSTALL_DIR) { + ghidraInstallDir = System.env.GHIDRA_INSTALL_DIR +} + +project.logger.lifecycle("Using Ghidra install directory " + ghidraInstallDir) if (ghidraInstallDir) { apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"