|
4 | 4 | import org.mangorage.bootstrap.api.dependency.IDependencyLocator; |
5 | 5 | import org.mangorage.bootstrap.api.launch.ILaunchTarget; |
6 | 6 | import org.mangorage.bootstrap.api.launch.ILaunchTargetEntrypoint; |
7 | | -import org.mangorage.bootstrap.internal.DependencyHandler; |
8 | 7 | import org.mangorage.bootstrap.internal.util.Util; |
9 | | -import org.mangorage.bootstrap.internal.util.Result; |
10 | 8 |
|
11 | 9 | import java.io.IOException; |
12 | 10 | import java.lang.module.Configuration; |
|
23 | 21 | import java.util.ServiceLoader; |
24 | 22 | import java.util.Set; |
25 | 23 |
|
26 | | -import static org.mangorage.bootstrap.internal.util.Util.callMain; |
27 | | - |
28 | 24 | public final class MangoBotLaunchTarget implements ILaunchTarget { |
29 | 25 |
|
30 | 26 | /** |
@@ -75,13 +71,10 @@ public String getId() { |
75 | 71 | public void launch(ModuleLayer parent, String[] args) throws Throwable { |
76 | 72 | final var pluginsPath = Path.of("plugins"); |
77 | 73 |
|
78 | | - List<IDependencyLocator> dependencyLocators = new ArrayList<>(); |
79 | | - dependencyLocators.add(new MangoBotDependencyLocator()); |
80 | | - |
81 | | -// ServiceLoader.load(IDependencyLocator.class) |
82 | | -// .stream() |
83 | | -// .map(ServiceLoader.Provider::get) |
84 | | -// .toList(); |
| 74 | + List<IDependencyLocator> dependencyLocators = ServiceLoader.load(IDependencyLocator.class) |
| 75 | + .stream() |
| 76 | + .map(ServiceLoader.Provider::get) |
| 77 | + .toList(); |
85 | 78 |
|
86 | 79 | final Map<String, List<IDependency>> dependencies = new HashMap<>(); |
87 | 80 |
|
@@ -123,7 +116,8 @@ public void launch(ModuleLayer parent, String[] args) throws Throwable { |
123 | 116 |
|
124 | 117 | final var moduleCfg = Configuration.resolve( |
125 | 118 | ModuleFinder.of( |
126 | | - finalDependencies.values().stream() |
| 119 | + finalDependencies.values() |
| 120 | + .stream() |
127 | 121 | .map(IDependency::resolveJar) |
128 | 122 | .toArray(Path[]::new) |
129 | 123 | ), |
|
0 commit comments