Skip to content

Commit 38a0854

Browse files
committed
Fixed RunBotJPMSTask
Now properly supports JPMS AND debug wont break...
1 parent f270694 commit 38a0854

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ apply plugin: 'java'
4545
apply plugin: 'maven-publish'
4646

4747
group = 'org.mangorage'
48-
version = getLatestGitTag() + "." + getLatestGitVersion()
48+
version = getLatestGitTag() + "." + getLatestGitVersion() + ".beta.1"
4949

5050
println("Version -> " + version)
5151

src/main/java/org/mangorage/mangobotgradle/tasks/RunBotJPMSTask.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,14 @@ public RunBotJPMSTask(Config config, String group, List<String> args) {
2626
setArgs(args);
2727
getMainClass().set("");
2828

29-
setClasspath(getProject().files()); // EMPTY CLASSPATH, this is MODULE mode
30-
3129
// Create your module path from the config
3230
FileCollection modulePath = getProject().getConfigurations().getByName(
3331
config.isPluginDevMode() ? "bot" : "botInternal"
3432
);
3533

36-
// Use JVM args to go full module mode
37-
List<String> jvmArgs = new ArrayList<>();
38-
jvmArgs.add("--module-path");
39-
jvmArgs.add(modulePath.getAsPath());
40-
41-
jvmArgs.add("-m");
42-
jvmArgs.add("org.mangorage.mangobotcore/org.mangorage.mangobot.loader.Loader");
43-
44-
setJvmArgs(jvmArgs);
34+
setClasspath(modulePath); // EMPTY CLASSPATH, this is MODULE mode
35+
getMainClass().set("org.mangorage.mangobot.loader.Loader");
36+
getMainModule().set("org.mangorage.mangobotcore");
37+
getModularity().getInferModulePath().set(true);
4538
}
4639
}

0 commit comments

Comments
 (0)