Skip to content

Commit df0bb35

Browse files
authored
Fix runtime classpath for the created launch scripts (#303)
1 parent 28966d1 commit df0bb35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/net/neoforged/moddevgradle/internal/ModDevRunWorkflow.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ private static TaskProvider<PrepareRun> setupRunInGradle(
393393
task.setDescription("Creates a bash/shell-script to launch the " + run.getName() + " Minecraft run from outside Gradle or your IDE.");
394394

395395
task.getWorkingDirectory().set(run.getGameDirectory().map(d -> d.getAsFile().getAbsolutePath()));
396-
task.getRuntimeClasspath().setFrom(runtimeClasspathConfig);
396+
// Note: this contains both the runtimeClasspath configuration and the sourceset's outputs.
397+
// This records a dependency on compiling and processing the resources of the source set.
398+
task.getRuntimeClasspath().from(run.getSourceSet().map(SourceSet::getRuntimeClasspath));
397399
task.getLaunchScript().set(RunUtils.getLaunchScript(argFileDir, run));
398400
task.getClasspathArgsFile().set(RunUtils.getArgFile(argFileDir, run, RunUtils.RunArgFile.CLASSPATH));
399401
task.getVmArgsFile().set(prepareRunTask.get().getVmArgsFile().map(d -> d.getAsFile().getAbsolutePath()));

0 commit comments

Comments
 (0)