Skip to content

Commit

Permalink
Pain
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jul 4, 2024
1 parent a616311 commit 1dd4837
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ public void runtime(final String neoFormVersion, Directory patches, Directory re
"reverseParchment",
mergeMappings.flatMap(WithOutput::getOutput).map(RegularFile::getAsFile),
project.provider(() -> ""),
project.getLayout().file(project.provider(() -> sourceSetDir)),
project.provider(() -> sourceSetDir),
false,
runtimeDefinition.getSpecification(),
workingDirectory,
strippedJar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import javax.inject.Inject;
import java.io.File;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

public abstract class RuntimeDevRuntimeExtension extends CommonRuntimeExtension<RuntimeDevRuntimeSpecification, RuntimeDevRuntimeSpecification.Builder, RuntimeDevRuntimeDefinition> {

Expand All @@ -44,7 +46,8 @@ public RuntimeDevRuntimeExtension(Project project) {
"applyParchment",
getProject().provider(() -> ToolUtilities.resolveTool(getProject(), spec.getParchmentArtifact())),
getProject().provider(() -> "p_"),
neoformRuntime.getSourceJarTask().flatMap(WithOutput::getOutput),
neoformRuntime.getSourceJarTask().flatMap(WithOutput::getOutput).map(RegularFile::getAsFile),
true,
spec,
workingDirectory,
null
Expand Down Expand Up @@ -83,7 +86,8 @@ public static TaskProvider<DefaultExecute> applyParchment(Project project,
String name,
Provider<File> mappingsFile,
Provider<String> conflictPrefix,
Provider<RegularFile> input,
Provider<File> input,
boolean inputFile,
RuntimeDevRuntimeSpecification spec,
File workingDirectory,
@Nullable TaskProvider<? extends WithOutput> extraClasspath) {
Expand All @@ -92,13 +96,18 @@ public static TaskProvider<DefaultExecute> applyParchment(Project project,

task.getOutputs().upToDateWhen(s -> false);
task.getArguments().putFile("mappings", mappingsFile);
task.getArguments().putFile("input", input.map(RegularFile::getAsFile));
if (inputFile) {
task.getArguments().putFile("input", input);
} else {
task.getArguments().putDirectoryFile("input", input);
}

task.getExecutingJar().set(toolExecutable);
task.getProgramArguments().add("--enable-parchment");
task.getProgramArguments().add("--no-parchment-javadoc");
task.getProgramArguments().add("--parchment-mappings");
task.getProgramArguments().add("{mappings}");
task.getProgramArguments().add("--in-format=" + (inputFile ? "archive" : "folder"));
task.getProgramArguments().add("--out-format=archive");
if (conflictPrefix.isPresent() && !conflictPrefix.get().isBlank()) {
task.getProgramArguments().add("--parchment-conflict-prefix=%s".formatted(conflictPrefix.get()));
Expand Down

0 comments on commit 1dd4837

Please sign in to comment.