mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-01 21:17:46 -05:00
Update to Mapping-IO 0.7.0 & Tiny Remapper 0.11 (#1245)
* Update to Mapping-IO 0.7.0 * Update to Mapping-IO 0.7.1 * Revert changes * Update tiny remapper * Fix invalid tiny v2 header.
This commit is contained in:
@@ -6,9 +6,9 @@ gson = "2.10.1"
|
||||
guava = "33.0.0-jre"
|
||||
|
||||
stitch = "0.6.2"
|
||||
tiny-remapper = "0.10.4"
|
||||
tiny-remapper = "0.11.0"
|
||||
access-widener = "2.1.0"
|
||||
mapping-io = "0.6.1"
|
||||
mapping-io = "0.7.1"
|
||||
lorenz-tiny = "4.0.2"
|
||||
mercury = "0.4.2"
|
||||
loom-native = "0.2.0"
|
||||
|
||||
@@ -55,6 +55,7 @@ import net.fabricmc.loom.extension.RemapperExtensionHolder;
|
||||
import net.fabricmc.loom.util.Constants;
|
||||
import net.fabricmc.loom.util.Pair;
|
||||
import net.fabricmc.loom.util.TinyRemapperHelper;
|
||||
import net.fabricmc.loom.util.TinyRemapperLoggerAdapter;
|
||||
import net.fabricmc.loom.util.ZipUtils;
|
||||
import net.fabricmc.loom.util.kotlin.KotlinClasspathService;
|
||||
import net.fabricmc.loom.util.kotlin.KotlinRemapperClassloader;
|
||||
@@ -139,7 +140,7 @@ public class ModProcessor {
|
||||
knownIndyBsms.addAll(modDependency.getMetadata().knownIdyBsms());
|
||||
}
|
||||
|
||||
TinyRemapper.Builder builder = TinyRemapper.newRemapper()
|
||||
TinyRemapper.Builder builder = TinyRemapper.newRemapper(TinyRemapperLoggerAdapter.INSTANCE)
|
||||
.withKnownIndyBsm(knownIndyBsms)
|
||||
.withMappings(TinyRemapperHelper.create(mappingConfiguration.getMappingsService(project, serviceFactory).getMappingTree(), fromM, toM, false))
|
||||
.renameInvalidLocals(false)
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.fabricmc.loom.api.mappings.intermediate.IntermediateMappingsProvider;
|
||||
*/
|
||||
public abstract class NoOpIntermediateMappingsProvider extends IntermediateMappingsProvider {
|
||||
private static final String HEADER_OFFICIAL_MERGED = "tiny\t2\t0\tofficial\tintermediary";
|
||||
private static final String HEADER_OFFICIAL_LEGACY_MERGED = "tiny\t2\t0\tintermediary\tclientOfficial\tserverOfficial\t";
|
||||
private static final String HEADER_OFFICIAL_LEGACY_MERGED = "tiny\t2\t0\tintermediary\tclientOfficial\tserverOfficial";
|
||||
|
||||
@Override
|
||||
public void provide(Path tinyMappings) throws IOException {
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.fabricmc.loom.api.mappings.layered.MappingsNamespace;
|
||||
import net.fabricmc.loom.configuration.ConfigContext;
|
||||
import net.fabricmc.loom.configuration.providers.BundleMetadata;
|
||||
import net.fabricmc.loom.util.Constants;
|
||||
import net.fabricmc.loom.util.TinyRemapperLoggerAdapter;
|
||||
import net.fabricmc.tinyremapper.NonClassCopyMode;
|
||||
import net.fabricmc.tinyremapper.OutputConsumerPath;
|
||||
import net.fabricmc.tinyremapper.TinyRemapper;
|
||||
@@ -94,7 +95,7 @@ public abstract sealed class SingleJarMinecraftProvider extends MinecraftProvide
|
||||
TinyRemapper remapper = null;
|
||||
|
||||
try {
|
||||
remapper = TinyRemapper.newRemapper().build();
|
||||
remapper = TinyRemapper.newRemapper(TinyRemapperLoggerAdapter.INSTANCE).build();
|
||||
|
||||
Files.deleteIfExists(minecraftEnvOnlyJar);
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ import net.fabricmc.accesswidener.AccessWidenerReader;
|
||||
import net.fabricmc.accesswidener.AccessWidenerVisitor;
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.api.mappings.layered.MappingsNamespace;
|
||||
import net.fabricmc.loom.util.TinyRemapperLoggerAdapter;
|
||||
import net.fabricmc.tinyremapper.TinyRemapper;
|
||||
import net.fabricmc.tinyremapper.api.TrEnvironment;
|
||||
|
||||
@@ -70,7 +71,7 @@ public abstract class ValidateAccessWidenerTask extends DefaultTask {
|
||||
|
||||
@TaskAction
|
||||
public void run() {
|
||||
final TinyRemapper tinyRemapper = TinyRemapper.newRemapper().build();
|
||||
final TinyRemapper tinyRemapper = TinyRemapper.newRemapper(TinyRemapperLoggerAdapter.INSTANCE).build();
|
||||
|
||||
for (File file : getTargetJars().getFiles()) {
|
||||
tinyRemapper.readClassPath(file.toPath());
|
||||
|
||||
@@ -54,6 +54,7 @@ import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.extension.RemapperExtensionHolder;
|
||||
import net.fabricmc.loom.task.AbstractRemapJarTask;
|
||||
import net.fabricmc.loom.util.Constants;
|
||||
import net.fabricmc.loom.util.TinyRemapperLoggerAdapter;
|
||||
import net.fabricmc.loom.util.kotlin.KotlinClasspathService;
|
||||
import net.fabricmc.loom.util.kotlin.KotlinRemapperClassloader;
|
||||
import net.fabricmc.loom.util.service.Service;
|
||||
@@ -130,7 +131,7 @@ public class TinyRemapperService extends Service<TinyRemapperService.Options> im
|
||||
}
|
||||
|
||||
private TinyRemapper createTinyRemapper() {
|
||||
TinyRemapper.Builder builder = TinyRemapper.newRemapper()
|
||||
TinyRemapper.Builder builder = TinyRemapper.newRemapper(TinyRemapperLoggerAdapter.INSTANCE)
|
||||
.withKnownIndyBsm(Set.copyOf(getOptions().getKnownIndyBsms().get()));
|
||||
|
||||
for (MappingsService.Options options : getOptions().getMappings().get()) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public final class TinyRemapperHelper {
|
||||
|
||||
int intermediaryNsId = mappingTree.getNamespaceId(MappingsNamespace.INTERMEDIARY.toString());
|
||||
|
||||
TinyRemapper.Builder builder = TinyRemapper.newRemapper()
|
||||
TinyRemapper.Builder builder = TinyRemapper.newRemapper(TinyRemapperLoggerAdapter.INSTANCE)
|
||||
.withMappings(create(mappingTree, fromM, toM, true))
|
||||
.withMappings(out -> JSR_TO_JETBRAINS.forEach(out::acceptClass))
|
||||
.renameInvalidLocals(true)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of fabric-loom, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2025 FabricMC
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.fabricmc.loom.util;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.fabricmc.tinyremapper.api.TrLogger;
|
||||
|
||||
public final class TinyRemapperLoggerAdapter implements TrLogger {
|
||||
public static final TinyRemapperLoggerAdapter INSTANCE = new TinyRemapperLoggerAdapter();
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger("TinyRemapper");
|
||||
|
||||
private TinyRemapperLoggerAdapter() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(Level level, String message) {
|
||||
switch (level) {
|
||||
case ERROR:
|
||||
LOGGER.error(message);
|
||||
break;
|
||||
case WARN:
|
||||
LOGGER.warn(message);
|
||||
break;
|
||||
case INFO:
|
||||
LOGGER.info(message);
|
||||
break;
|
||||
case DEBUG:
|
||||
LOGGER.debug(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user