Skip to content

Commit

Permalink
Unconditionally add minecraft to the main&test classpaths
Browse files Browse the repository at this point in the history
Closes #25
  • Loading branch information
eigenraven committed May 8, 2023
1 parent 84d697b commit 76da930
Showing 1 changed file with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ public MCPTasks(Project project, MinecraftExtension mcExt, MinecraftTasks mcTask
set -> { set.getJava().setSrcDirs(project.files(injectedSourcesLocation).builtBy(taskInjectTags)); });
project.getTasks().named(injectedSourceSet.getCompileJavaTaskName())
.configure(task -> task.dependsOn(taskInjectTags));
mainSet.setCompileClasspath(mainSet.getCompileClasspath().plus(injectedSourceSet.getOutput()));
mainSet.setRuntimeClasspath(
mainSet.getRuntimeClasspath().plus(injectedSourceSet.getOutput()).plus(launcherSources.getOutput()));
testSet.setCompileClasspath(testSet.getCompileClasspath().plus(injectedSourceSet.getOutput()));
testSet.setRuntimeClasspath(
testSet.getRuntimeClasspath().plus(injectedSourceSet.getOutput()).plus(launcherSources.getOutput()));
final FileCollection mcCp = launcherSources.getOutput().plus(patchedMcSources.getOutput());
final FileCollection extraCp = mcCp.plus(injectedSourceSet.getOutput());
mainSet.setCompileClasspath(mainSet.getCompileClasspath().plus(extraCp));
mainSet.setRuntimeClasspath(mainSet.getRuntimeClasspath().plus(extraCp));
testSet.setCompileClasspath(testSet.getCompileClasspath().plus(extraCp));
testSet.setRuntimeClasspath(testSet.getRuntimeClasspath().plus(extraCp));
project.getTasks().named("jar", Jar.class)
.configure(task -> task.from(injectedSourceSet.getOutput().getAsFileTree()));

Expand Down Expand Up @@ -1070,14 +1070,6 @@ private void afterEvaluate() {
task.getPatches().from(userdevFile("patches.zip"));
}
});

final SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
final SourceSet mainSet = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME);
final ConfigurableFileCollection mcCp = project.getObjects().fileCollection();
mcCp.from(launcherSources.getOutput());
mcCp.from(patchedMcSources.getOutput());
mainSet.setCompileClasspath(mainSet.getCompileClasspath().plus(mcCp));
mainSet.setRuntimeClasspath(mainSet.getRuntimeClasspath().plus(mcCp));
}
}
}
Expand Down

0 comments on commit 76da930

Please sign in to comment.