mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
Gradle 7 (and hopefully 8) support (#332)
* First pass on gradle 7 support * Fix Gradle 8 deprecation warnings * Add a deprecated compile constant
This commit is contained in:
@@ -27,9 +27,11 @@ package net.fabricmc.loom.util;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import net.fabricmc.loom.configuration.RemappedConfigurationEntry;
|
||||
import net.fabricmc.loom.util.gradle.GradleSupport;
|
||||
|
||||
public class Constants {
|
||||
public static final String LIBRARIES_BASE = "https://libraries.minecraft.net/";
|
||||
@@ -40,14 +42,23 @@ public class Constants {
|
||||
|
||||
public static final int ASM_VERSION = Opcodes.ASM9;
|
||||
|
||||
public static final List<RemappedConfigurationEntry> MOD_COMPILE_ENTRIES = ImmutableList.of(
|
||||
new RemappedConfigurationEntry("modCompile", "compile", true, "compile"),
|
||||
new RemappedConfigurationEntry("modApi", "api", true, "compile"),
|
||||
new RemappedConfigurationEntry("modImplementation", "implementation", true, "runtime"),
|
||||
new RemappedConfigurationEntry("modRuntime", "runtimeOnly", false, ""),
|
||||
new RemappedConfigurationEntry("modCompileOnly", "compileOnly", true, "")
|
||||
private static final List<RemappedConfigurationEntry> LEGACY_MOD_COMPILE_ENTRIES = ImmutableList.of(
|
||||
new RemappedConfigurationEntry("modCompile", Configurations.COMPILE, true, "compile"),
|
||||
new RemappedConfigurationEntry("modApi", JavaPlugin.API_CONFIGURATION_NAME, true, "compile"),
|
||||
new RemappedConfigurationEntry("modImplementation", JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, true, "runtime"),
|
||||
new RemappedConfigurationEntry("modRuntime", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, ""),
|
||||
new RemappedConfigurationEntry("modCompileOnly", JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, true, "")
|
||||
);
|
||||
|
||||
private static final List<RemappedConfigurationEntry> MODERN_MOD_COMPILE_ENTRIES = ImmutableList.of(
|
||||
new RemappedConfigurationEntry("modApi", JavaPlugin.API_CONFIGURATION_NAME, true, "compile"),
|
||||
new RemappedConfigurationEntry("modImplementation", JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, true, "runtime"),
|
||||
new RemappedConfigurationEntry("modRuntime", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, ""),
|
||||
new RemappedConfigurationEntry("modCompileOnly", JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, true, "")
|
||||
);
|
||||
|
||||
public static final List<RemappedConfigurationEntry> MOD_COMPILE_ENTRIES = GradleSupport.IS_GRADLE_7_OR_NEWER ? MODERN_MOD_COMPILE_ENTRIES : LEGACY_MOD_COMPILE_ENTRIES;
|
||||
|
||||
private Constants() {
|
||||
}
|
||||
|
||||
@@ -65,6 +76,8 @@ public class Constants {
|
||||
public static final String MAPPINGS = "mappings";
|
||||
public static final String MAPPINGS_FINAL = "mappingsFinal";
|
||||
public static final String LOADER_DEPENDENCIES = "loaderLibraries";
|
||||
@Deprecated // Not to be used in gradle 7+
|
||||
public static final String COMPILE = "compile";
|
||||
|
||||
private Configurations() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user