Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Minecraft jar names clearer #58

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,16 @@ public void apply(Project project) {
task.getParchmentData().from(parchmentData);

var minecraftArtifactsDir = modDevBuildDir.map(dir -> dir.dir("artifacts"));
task.getCompiledArtifact().set(minecraftArtifactsDir.map(dir -> dir.file("neoforge-minecraft-joined-local.jar")));
task.getCompiledWithSourcesArtifact().set(minecraftArtifactsDir.map(dir -> dir.file("neoforge-minecraft-joined-local-merged.jar")));
task.getSourcesArtifact().set(minecraftArtifactsDir.map(dir -> dir.file("neoforge-minecraft-joined-local-sources.jar")));
task.getResourcesArtifact().set(minecraftArtifactsDir.map(dir -> dir.file("neoforge-minecraft-joined-local-resources-aka-client-extra.jar")));
Function<String, Provider<RegularFile>> jarPathFactory = suffix -> {
return minecraftArtifactsDir.zip(
// It's helpful to be able to differentiate the Vanilla jar and the NeoForge jar in classic multiloader setups.
extension.getVersion().map(v -> "neoforge-" + v).orElse(extension.getNeoFormVersion().map(v -> "vanilla-" + v)),
(dir, prefix) -> dir.file(prefix + "-minecraft" + suffix + ".jar"));
};
task.getCompiledArtifact().set(jarPathFactory.apply(""));
task.getCompiledWithSourcesArtifact().set(jarPathFactory.apply("-merged"));
task.getSourcesArtifact().set(jarPathFactory.apply("-sources"));
task.getResourcesArtifact().set(jarPathFactory.apply("-resources-aka-client-extra"));
Matyrobbrt marked this conversation as resolved.
Show resolved Hide resolved

configureEngineTask.accept(task);
});
Expand Down
Loading