From ecdf92eb05f7098ae29c4fdcd0b986cbc2817b12 Mon Sep 17 00:00:00 2001 From: ghidra4 <48601690+ghidra4@users.noreply.github.com> Date: Wed, 24 Apr 2019 17:38:24 -0400 Subject: [PATCH] getLogFileUrl no longer searches user.dir for log4j properties file GT-2834 --- gradle/root/test.gradle | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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. *********************************************************************************/