Skip to content

Ghidra is a software reverse engineering (SRE) framework

getLogFileUrl no longer searches user.dir for log4j properties file GT-2834

ghidra4ecdf92eb05f7
diff --git a/gradle/root/test.gradle b/gradle/root/test.gradle
index 2618d10c9b..947fd7f107 100644
--- a/gradle/root/test.gradle
+++ b/gradle/root/test.gradle
@@ -121,22 +121,17 @@ def createDir(dirPath) {
}
/*********************************************************************************
- * Finds the log4j properties file and returns its path.
+ * Retrieves log4j properties file and returns its path.
*********************************************************************************/
def getLogFileUrl() {
- String rootDir = System.properties.get("user.dir")
- String foundFile
- new File(rootDir).eachFileRecurse(groovy.io.FileType.FILES) {
- if (it.path.endsWith('src/main/resources/generic.log4jtest.xml')) {
- foundFile = "file:" + it.path.toString()
- return "file:" + it.path.toString()
- }
+ String logFilePath = "$rootDir/Ghidra/Framework/Generic/src/main/resources/generic.log4jtest.xml"
+ File logFile = new File(logFilePath)
+ if (logFile.exists()) {
+ return logFile.toURI().toString()
}
-
- return foundFile
+ throw new GradleException("Cannot find log4j properties file using path '$logFilePath'")
}
-
/*********************************************************************************
* Creates a new debug port randomly.
*********************************************************************************/