mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GT-2941: Generic support for moving "fat jar" to the end of the
classpath.
This commit is contained in:
parent
ba37c1bae4
commit
d8da078251
3 changed files with 39 additions and 10 deletions
|
@ -15,12 +15,11 @@
|
|||
*/
|
||||
package utility.module;
|
||||
|
||||
import generic.jar.ResourceFile;
|
||||
import ghidra.util.Msg;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import generic.jar.ResourceFile;
|
||||
import ghidra.util.Msg;
|
||||
import utilities.util.FileUtilities;
|
||||
|
||||
public class ModuleManifestFile {
|
||||
|
@ -32,6 +31,7 @@ public class ModuleManifestFile {
|
|||
private static final String EXCLUDE_FROM_GHIDRA_JAR = "EXCLUDE FROM GHIDRA JAR";
|
||||
private static final String DATA_SEARCH_IGNORE_DIR = "DATA SEARCH IGNORE DIR:";
|
||||
private static final String MODULE_DIR_IDENTIFIER = "MODULE DIR:";
|
||||
private static final String FAT_JAR = "FAT JAR:";
|
||||
// private static final String EXTENSION_SUFFIX = "EXTENSION SUFFIX:";
|
||||
// private static final String REQUIRES_CLASS_SEARCH = "REQUIRES CLASS SEARCH:";
|
||||
// private static final String OWNER_IDENTIFIER = "MODULE DIR:";
|
||||
|
@ -46,6 +46,7 @@ public class ModuleManifestFile {
|
|||
private Map<String, String> fileIPMap = new HashMap<String, String>();
|
||||
|
||||
private Set<String> dataSearchIgnoreDirs = new HashSet<String>();
|
||||
private Set<String> fatJars = new HashSet<>();
|
||||
|
||||
public ModuleManifestFile(File moduleRootDir) throws IOException {
|
||||
this(new ResourceFile(moduleRootDir));
|
||||
|
@ -108,6 +109,9 @@ public class ModuleManifestFile {
|
|||
else if (trimmedLine.startsWith(MODULE_DIR_IDENTIFIER)) {
|
||||
// do nothing for now
|
||||
}
|
||||
else if (trimmedLine.startsWith(FAT_JAR)) {
|
||||
processFatJar(trimmedLine);
|
||||
}
|
||||
else {
|
||||
String message =
|
||||
"Module manifest file error on line " + (lineNumber + 1) + " of file: " + file +
|
||||
|
@ -144,6 +148,11 @@ public class ModuleManifestFile {
|
|||
moduleName = line.substring(NAME_IDENTIFIER.length()).trim();
|
||||
}
|
||||
|
||||
private void processFatJar(String line) {
|
||||
String fatJar = line.substring(FAT_JAR.length()).trim();
|
||||
fatJars.add(fatJar);
|
||||
}
|
||||
|
||||
public String getModuleName() {
|
||||
return moduleName;
|
||||
}
|
||||
|
@ -151,4 +160,8 @@ public class ModuleManifestFile {
|
|||
public Set<String> getDataSearchIgnoreDirs() {
|
||||
return dataSearchIgnoreDirs;
|
||||
}
|
||||
|
||||
public Set<String> getFatJars() {
|
||||
return fatJars;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue