Update mercury and set source compatibility version to 17

This commit is contained in:
modmuss50
2022-05-26 11:21:53 +01:00
parent 4f079f83aa
commit 07ded449ee
4 changed files with 8 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ dependencies {
implementation ('net.fabricmc:cfr:0.1.1')
// source code remapping
implementation ('net.fabricmc:mercury:0.2.5')
implementation ('net.fabricmc:mercury:0.2.6')
// Kotlin
implementation('org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.4.2') {

View File

@@ -1,7 +1,7 @@
/*
* This file is part of fabric-loom, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 FabricMC
* Copyright (c) 2021-2022 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
@@ -42,6 +42,7 @@ import org.slf4j.LoggerFactory;
import net.fabricmc.loom.LoomGradleExtension;
import net.fabricmc.loom.task.RemapSourcesJarTask;
import net.fabricmc.loom.util.Constants;
import net.fabricmc.loom.util.DeletingFileVisitor;
import net.fabricmc.loom.util.FileSystemUtil;
import net.fabricmc.loom.util.SourceRemapper;
@@ -122,6 +123,7 @@ public final class SourceRemapperService implements SharedService {
private Mercury createMercury() {
var mercury = new Mercury();
mercury.setGracefulClasspathChecks(true);
mercury.setSourceCompatibility(Constants.MERCURY_SOURCE_VERSION);
try {
mercury.getProcessors().add(MercuryRemapper.create(getMappings()));

View File

@@ -27,6 +27,7 @@ package net.fabricmc.loom.util;
import java.util.List;
import com.google.common.collect.ImmutableList;
import org.eclipse.jdt.core.JavaCore;
import org.gradle.api.plugins.JavaPlugin;
import org.objectweb.asm.Opcodes;
@@ -41,6 +42,7 @@ public class Constants {
public static final String FABRIC_REPOSITORY = "https://maven.fabricmc.net/";
public static final int ASM_VERSION = Opcodes.ASM9;
public static final String MERCURY_SOURCE_VERSION = JavaCore.VERSION_17;
public static final List<RemappedConfigurationEntry> MOD_COMPILE_ENTRIES = ImmutableList.of(
new RemappedConfigurationEntry("modApi", JavaPlugin.API_CONFIGURATION_NAME, true, true, PublishingMode.COMPILE_AND_RUNTIME),

View File

@@ -1,7 +1,7 @@
/*
* This file is part of fabric-loom, licensed under the MIT License (MIT).
*
* Copyright (c) 2018-2021 FabricMC
* Copyright (c) 2018-2022 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
@@ -225,6 +225,7 @@ public class SourceRemapper {
public static Mercury createMercuryWithClassPath(Project project, boolean toNamed) {
Mercury m = new Mercury();
m.setGracefulClasspathChecks(true);
m.setSourceCompatibility(Constants.MERCURY_SOURCE_VERSION);
for (File file : project.getConfigurations().getByName(Constants.Configurations.LOADER_DEPENDENCIES).getFiles()) {
m.getClassPath().add(file.toPath());