mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 08:14:45 +00:00
Load pack modules from <pack>/modules jars
A module jar names its IrisModule class in META-INF/services/com.volmit.IrisModule. PackModules scans <pack>/modules/*.jar in file name order, loads all jars of a pack through one URLClassLoader whose parent is the API's loader, and closes it when the pack unloads. Modules now reach LoadedModules as DiscoveredModule (module plus origin), so errors name the offending jar: missing or multiple entry points, broken entry classes, duplicate module ids and foreign stage namespaces.
This commit is contained in:
1 parent
e918cd44a8
commit
6388173f19
12 files changed
+606
-29
No files matched your search
@@ -5,6 +5,7 @@ import com.volmit.ModuleInfo;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.example.placement.*;
|
||||
import com.volmit.host.ConfiguredSettings;
|
||||
import com.volmit.host.DiscoveredModule;
|
||||
import com.volmit.host.LoadedModules;
|
||||
import com.volmit.host.PlacementRunner;
|
||||
import com.volmit.host.ResolvedGraph;
|
||||
@@ -83,7 +84,7 @@ class PlacementLifecyclePortTest {
|
||||
|
||||
private static ResolvedGraph resolve(List<? extends IrisModule> modules) {
|
||||
var builder = new StageGraphBuilder();
|
||||
modules.forEach(builder::install);
|
||||
modules.stream().map(DiscoveredModule::builtIn).forEach(builder::install);
|
||||
return builder.resolve(Pipeline.PLACEMENT);
|
||||
}
|
||||
|
||||
@@ -196,7 +197,7 @@ class PlacementLifecyclePortTest {
|
||||
|
||||
@Test
|
||||
void loadingThePortCatalogsEveryConditioningSettingsType() {
|
||||
var loaded = LoadedModules.load(PlacementModules.all(), Map.of());
|
||||
var loaded = LoadedModules.load(PlacementModules.builtIns(), Map.of());
|
||||
|
||||
assertEquals(List.of("example:moss", "iris:snow", "iris:stilt"),
|
||||
loaded.catalog().settings().stream().map(settings -> settings.id().toString()).toList());
|
||||
|
||||
Reference in new issue
Block a user