Skip to content

Commit

Permalink
Use runtimeClasspath of run source set instead of main
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Jun 16, 2024
1 parent 8f347c8 commit de6b71d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ public void apply(Project project) {
});

var sourceSets = ExtensionUtils.getSourceSets(project);
var mainSourceSet = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME);
extension.addModdingDependenciesTo(mainSourceSet);
extension.addModdingDependenciesTo(sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME));

configurations.named(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME).configure(configuration -> {
configuration.withDependencies(dependencies -> {
Expand Down Expand Up @@ -380,7 +379,7 @@ public void apply(Project project) {
task.getJavaLauncher().set(toolchainService.launcherFor(spec -> spec.getLanguageVersion().set(javaExtension.getToolchain().getLanguageVersion())));
// 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(mainSourceSet.getRuntimeClasspath());
task.getClasspathProvider().from(run.getSourceSet().map(SourceSet::getRuntimeClasspath));
task.getGameDirectory().set(run.getGameDirectory());

task.getEnvironmentProperty().set(run.getEnvironment());
Expand Down

0 comments on commit de6b71d

Please sign in to comment.