mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GT-3350: Consistently ordered classpath and ExtensionPoint priorities
This commit is contained in:
parent
7ab75e411e
commit
8f00152601
52 changed files with 341 additions and 169 deletions
|
@ -26,6 +26,7 @@ import ghidra.util.Msg;
|
|||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.exception.AssertException;
|
||||
import utilities.util.FileUtilities;
|
||||
import utility.application.ApplicationLayout;
|
||||
|
||||
/**
|
||||
* Utility methods for module related things.
|
||||
|
@ -334,4 +335,21 @@ public class ModuleUtilities {
|
|||
}
|
||||
return findRepo(f.getParentFile());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the given {@link GModule module} is external to the Ghidra installation
|
||||
* directory
|
||||
*
|
||||
* @param module the module to check
|
||||
* @param layout Ghidra's layout
|
||||
* @return true if the given {@link GModule module} is external to the Ghidra installation
|
||||
* directory
|
||||
*/
|
||||
public static boolean isExternalModule(GModule module, ApplicationLayout layout) {
|
||||
File moduleRootDir = module.getModuleRoot().getFile(false);
|
||||
return !layout.getApplicationRootDirs()
|
||||
.stream()
|
||||
.map(dir -> dir.getParentFile().getFile(false))
|
||||
.anyMatch(dir -> FileUtilities.isPathContainedWithin(dir, moduleRootDir));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue