mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 16:54:04 +00:00
Add /iris std modules to list the modules a pack loads, with version, id and jar
This commit is contained in:
1 parent
24c03b66d7
commit
620d59ad7a
28 files changed
+473
-6
No files matched your search
@@ -83,6 +83,11 @@ public final class DiscoveredModule {
|
||||
return origin;
|
||||
}
|
||||
|
||||
/** Whether the module ships with the host, on its classpath or in a jar it bundles, instead of in the pack. */
|
||||
public boolean isBuiltIn() {
|
||||
return source == Source.HOST || origin.endsWith(PackModules.BUNDLED_ORIGIN_SUFFIX);
|
||||
}
|
||||
|
||||
/** The origin and the module's class, which tells apart two modules of one jar. */
|
||||
String locationWithClass() {
|
||||
return origin + " (" + module.getClass().getName() + ")";
|
||||
|
||||
@@ -23,7 +23,7 @@ final class PackModulesSummary {
|
||||
List<String> hostModules = new ArrayList<>();
|
||||
List<String> ownModules = new ArrayList<>();
|
||||
for (var module : modules) {
|
||||
if (isFromHost(module)) {
|
||||
if (module.isBuiltIn()) {
|
||||
hostModules.add(module.info().name());
|
||||
} else {
|
||||
ownModules.add(describeOwn(module));
|
||||
@@ -36,11 +36,6 @@ final class PackModulesSummary {
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
private static boolean isFromHost(DiscoveredModule module) {
|
||||
return module.origin().equals(DiscoveredModule.HOST_CLASSPATH)
|
||||
|| module.origin().endsWith(PackModules.BUNDLED_ORIGIN_SUFFIX);
|
||||
}
|
||||
|
||||
private static String describeOwn(DiscoveredModule discovered) {
|
||||
var info = discovered.info();
|
||||
return info.name() + " " + info.version() + " (" + discovered.origin() + ")";
|
||||
|
||||
Reference in new issue
Block a user