diff --git a/src/java17/java/net/neoforged/moddevgradle/internal/ModDevPluginImpl.java b/src/java17/java/net/neoforged/moddevgradle/internal/ModDevPluginImpl.java index 87bc2653..801555c7 100644 --- a/src/java17/java/net/neoforged/moddevgradle/internal/ModDevPluginImpl.java +++ b/src/java17/java/net/neoforged/moddevgradle/internal/ModDevPluginImpl.java @@ -301,6 +301,8 @@ public void apply(Project project) { extension.getRuns().configureEach(run -> { var type = RunUtils.getRequiredType(project, run); + var sourceSet = ExtensionUtils.getExtension(project, "sourceSets", SourceSetContainer.class).getByName("main"); + var legacyClasspathConfiguration = configurations.create(run.nameOf("", "legacyClasspath"), spec -> { spec.setCanBeResolved(true); spec.setCanBeConsumed(false); @@ -341,7 +343,9 @@ public void apply(Project project) { idePostSyncTask.configure(task -> task.dependsOn(prepareRunTask)); tasks.register(run.nameOf("run", ""), RunGameTask.class, task -> { - task.getClasspathProvider().from(configurations.named("runtimeClasspath")); + // Note: this contains both the runtimeClasspath configuration and the sourceset's outputs. + // This records a dependency on compiling and processing the resources of the source set. + task.getClasspathProvider().from(sourceSet.getRuntimeClasspath()); task.getGameDirectory().set(run.getGameDirectory()); task.jvmArgs(RunUtils.getArgFileParameter(prepareRunTask.get().getVmArgsFile().get()).replace("\\", "\\\\")); @@ -351,9 +355,6 @@ public void apply(Project project) { task.dependsOn(prepareRunTask); task.getJvmArgumentProviders().add(RunUtils.getGradleModFoldersProvider(project, run)); - - // TODO: how do we do this in a clean way for all source sets? - task.dependsOn(tasks.named("processResources")); }); });