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"