Merge remote-tracking branch

'origin/GP-970_ryanmkurtz_gradle-relative-paths' into Ghidra_10.0
(Closes #3047, Closes #3062)
This commit is contained in:
ghidra1 2021-06-03 10:53:49 -04:00
commit eec3e7b343

View File

@ -153,13 +153,22 @@ task generateDevGhidraServerClasspath {
outfile.withPrintWriter { out ->
int idx = 0
configurations.runGhidraServer.each { jarFile ->
def JAR_PATH = rootProject.relativePath(jarFile.absolutePath).replace('\\','/')
def index = JAR_PATH.indexOf("build/")
def JAR_PATH = jarFile.absolutePath
// There might be dependencies in the gradle cache, which could be anywhere
// (including a different drive). We can only use relative paths if the jar is in
// the root project repo or bin repo.
if (JAR_PATH.startsWith(rootProject.getProjectDir().absolutePath) || JAR_PATH.startsWith(BIN_REPO)) {
JAR_PATH = "\${ghidra_home}/" + rootProject.relativePath(JAR_PATH)
}
JAR_PATH = JAR_PATH.replace('\\','/') // necessary for windows
def index = JAR_PATH.indexOf("/build/")
if (index != -1) {
JAR_PATH = JAR_PATH.substring(0, index) + "bin/main"
// Use Module's bin/ class directory (produced by Eclipse) instead of jar
JAR_PATH = JAR_PATH.substring(0, index) + "/bin/main"
}
if (!jarFile.path.contains("/libsForBuild/")) {
out.println("wrapper.java.classpath.${++idx}=\${ghidra_home}/${JAR_PATH}")
out.println("wrapper.java.classpath.${++idx}=${JAR_PATH}")
}
}
}