Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Bump JST
Use conflict resolution based parchment handling.
  • Loading branch information
marchermans committed Jun 25, 2024
1 parent d6b89be commit 5de4aac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,11 @@ private void configureParchmentDefaults() {
return DEFAULT_PARCHMENT_GROUP
+ ":" + DEFAULT_PARCHMENT_ARTIFACT_PREFIX + minecraftVersion
+ ":" + mappingVersion
// We need the checked variant for now since it resolves
// parameters conflicting with local variables by prefixing everything with "p"
+ ":checked"
+ "@zip";
})
)
);
parchment.getConflictPrefix().convention("p_");
parchment.getMinecraftVersion().convention(
getStringProperty("parchment.minecraftVersion")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ interface Parchment extends ConfigurableDSLElement<Parchment> {
@DSLProperty
Property<String> getParchmentArtifact();

/**
* The prefix added to parameters in parchment when a conflict arises.
*/
@Input
@DSLProperty
Property<String> getConflictPrefix();

/**
* Minecraft version of parchment to use. This property is
* ignored if {@link #getParchmentArtifact()} is set explicitly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Constants {
public static final String DEFAULT_PARCHMENT_GROUP = "org.parchmentmc.data"
public static final String DEFAULT_PARCHMENT_ARTIFACT_PREFIX = "parchment-"
public static final String DEFAULT_PARCHMENT_MAVEN_URL = "https://maven.parchmentmc.org/"
public static final String JST_TOOL_ARTIFACT = "net.neoforged.jst:jst-cli-bundle:1.0.39"
public static final String JST_TOOL_ARTIFACT = "net.neoforged.jst:jst-cli-bundle:1.0.43"
public static final String DEVLOGIN_TOOL_ARTIFACT = "net.covers1624:DevLogin:0.1.0.4"
public static final String DEVLOGIN_MAIN_CLASS = "net.covers1624.devlogin.DevLogin"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ private static TaskProvider<? extends WithOutput> maybeApplyParchment(NeoFormRun
TaskProvider<? extends Runtime> applyParchmentTask = project.getTasks().register(CommonRuntimeUtils.buildTaskName(spec, "applyParchment"), DefaultExecute.class, task -> {
// Provide the mappings via artifact
File mappingFile = ToolUtilities.resolveTool(project, parchment.getParchmentArtifact().get());
String conflictPrefix = parchment.getConflictPrefix().get();
File toolExecutable = ToolUtilities.resolveTool(project, tools.getJST().get());

task.getArguments().putFile("mappings", project.provider(() -> mappingFile));
Expand All @@ -521,6 +522,7 @@ private static TaskProvider<? extends WithOutput> maybeApplyParchment(NeoFormRun
task.getProgramArguments().add("{mappings}");
task.getProgramArguments().add("--in-format=archive");
task.getProgramArguments().add("--out-format=archive");
task.getProgramArguments().add("--parchment-conflict-prefix=%s".formatted(conflictPrefix));
task.getProgramArguments().add("{input}");
task.getProgramArguments().add("{output}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ class E2ETests extends BuilderBasedTestSpecification {
patchedRun.task(":neoforge:assemble").outcome == TaskOutcome.SUCCESS
patchedRun.task(":neoforge:userdevJar").outcome == TaskOutcome.SUCCESS

def userdevJar = project.patchedProject.file("build/libs/neoforge-1.0.0-userdev-contains-patch-userdev.jar")
def userdevJar = project.patchedProject.file("build/libs/neoforge-1.0.0-userdev-with-patch-userdev.jar")
userdevJar.exists()

def patch = userdevJar.getZipEntry(PATCH_RESULT_PATH)
Expand Down

0 comments on commit 5de4aac

Please sign in to comment.