mirror of https://github.com/FabricMC/yarn.git
Merge branch '24w10a' into 24w10a-stuff
This commit is contained in:
commit
4971de04e2
|
@ -12,6 +12,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./gradlew build javadocJar checkMappings --stacktrace --warning-mode fail
|
- run: ./gradlew build javadocJar checkMappings --stacktrace --warning-mode fail
|
||||||
|
- run: ./gradlew formatMappings --stacktrace --warning-mode fail
|
||||||
|
- name: Check mapping format
|
||||||
|
run: if [ -n "$(git status --porcelain)" ]; then exit 1; fi
|
||||||
- name: Build artifacts
|
- name: Build artifacts
|
||||||
if: ${{ matrix.java == '21-jdk' }}
|
if: ${{ matrix.java == '21-jdk' }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
|
@ -56,3 +56,6 @@ Downloads the client and server Minecraft jars for the current Minecraft version
|
||||||
|
|
||||||
### `mergeJars`
|
### `mergeJars`
|
||||||
Merges the client and server jars into one merged jar, located at `VERSION-merged.jar` in the mappings directory where `VERSION` is the current Minecraft version.
|
Merges the client and server jars into one merged jar, located at `VERSION-merged.jar` in the mappings directory where `VERSION` is the current Minecraft version.
|
||||||
|
|
||||||
|
### `formatMappings`
|
||||||
|
Formats and sorts the mappings, ensuring that they are in a consistent order.
|
|
@ -106,6 +106,7 @@ import net.fabricmc.filament.task.base.WithFileOutput
|
||||||
import net.fabricmc.filament.task.enigma.MapSpecializedMethodsTask
|
import net.fabricmc.filament.task.enigma.MapSpecializedMethodsTask
|
||||||
import net.fabricmc.filament.task.mappingio.CompleteMappingsTask
|
import net.fabricmc.filament.task.mappingio.CompleteMappingsTask
|
||||||
import net.fabricmc.filament.task.mappingio.ConvertMappingsTask
|
import net.fabricmc.filament.task.mappingio.ConvertMappingsTask
|
||||||
|
import net.fabricmc.filament.task.mappingio.FormatMappingsTask
|
||||||
import net.fabricmc.filament.task.mappingio.MergeMappingsTask
|
import net.fabricmc.filament.task.mappingio.MergeMappingsTask
|
||||||
import net.fabricmc.mappingio.format.MappingFormat
|
import net.fabricmc.mappingio.format.MappingFormat
|
||||||
import net.fabricmc.nameproposal.MappingNameCompleter
|
import net.fabricmc.nameproposal.MappingNameCompleter
|
||||||
|
@ -458,6 +459,10 @@ tasks.register('decompileCFR', JavaExec) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register("formatMappings", FormatMappingsTask) {
|
||||||
|
input = file("mappings")
|
||||||
|
}
|
||||||
|
|
||||||
javadoc {
|
javadoc {
|
||||||
dependsOn genFakeSource
|
dependsOn genFakeSource
|
||||||
group = "javadoc generation"
|
group = "javadoc generation"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
filament_version=0.7.1
|
filament_version=0.8.0
|
|
@ -0,0 +1,41 @@
|
||||||
|
package net.fabricmc.filament.task.mappingio;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import org.gradle.api.file.DirectoryProperty;
|
||||||
|
import org.gradle.api.tasks.InputDirectory;
|
||||||
|
import org.gradle.api.tasks.OutputDirectory;
|
||||||
|
import org.gradle.api.tasks.TaskAction;
|
||||||
|
|
||||||
|
import net.fabricmc.filament.task.base.FilamentTask;
|
||||||
|
import net.fabricmc.mappingio.MappingReader;
|
||||||
|
import net.fabricmc.mappingio.MappingWriter;
|
||||||
|
import net.fabricmc.mappingio.format.MappingFormat;
|
||||||
|
import net.fabricmc.mappingio.tree.MemoryMappingTree;
|
||||||
|
import net.fabricmc.mappingio.tree.VisitOrder;
|
||||||
|
|
||||||
|
public abstract class FormatMappingsTask extends FilamentTask {
|
||||||
|
@InputDirectory
|
||||||
|
public abstract DirectoryProperty getInput();
|
||||||
|
|
||||||
|
@OutputDirectory
|
||||||
|
protected abstract DirectoryProperty getOutput();
|
||||||
|
|
||||||
|
public FormatMappingsTask() {
|
||||||
|
getOutput().set(getInput());
|
||||||
|
}
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
void run() throws IOException {
|
||||||
|
Path path = getInput().get().getAsFile().toPath();
|
||||||
|
|
||||||
|
MappingWriter writer = MappingWriter.create(path, MappingFormat.ENIGMA_DIR);
|
||||||
|
Objects.requireNonNull(writer, "writer");
|
||||||
|
|
||||||
|
MemoryMappingTree tree = new MemoryMappingTree();
|
||||||
|
MappingReader.read(path, MappingFormat.ENIGMA_DIR, tree);
|
||||||
|
tree.accept(writer, VisitOrder.createByName());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue