Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/upstream/dev/1.6' into tmp…
Browse files Browse the repository at this point in the history
…/1.6

# Conflicts:
#	build.gradle
#	gradle/test.libs.versions.toml
#	src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java
#	src/main/java/net/fabricmc/loom/configuration/providers/forge/minecraft/MergedForgeMinecraftProvider.java
#	src/main/java/net/fabricmc/loom/util/Constants.java
#	src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java
#	src/test/resources/projects/kotlin/build.gradle.kts
  • Loading branch information
DJtheRedstoner committed Apr 30, 2024
2 parents eec703d + ff3546e commit 1503992
Show file tree
Hide file tree
Showing 154 changed files with 5,612 additions and 1,423 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- 'dev/1.3'
- 'dev/1.4'
- 'dev/1.5'
- 'dev/1.6'

jobs:
build:
Expand All @@ -24,7 +25,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [8.3.0-jdk17]
version: [8.6.0-jdk17]
runs-on: ubuntu-22.04
container:
image: gradle:${{ matrix.version }}
options: --user root
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v2
- run: gradle build check -x test --stacktrace --warning-mode fail
- uses: Juuxel/publish-checkstyle-report@v1
if: ${{ failure() }}
Expand All @@ -34,7 +34,7 @@ jobs:
with:
java-version: 17
distribution: 'temurin'
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v2
- run: ./gradlew build check -x test --stacktrace --warning-mode fail

# This job is used to feed the test matrix of next job to allow the tests to run in parallel
Expand All @@ -44,7 +44,7 @@ jobs:

runs-on: ubuntu-22.04
container:
image: gradle:8.3.0-jdk17
image: gradle:8.6.0-jdk17
options: --user root

steps:
Expand All @@ -63,7 +63,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [8.3.0-jdk17]
version: [8.6.0-jdk17]
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}

runs-on: ubuntu-22.04
Expand All @@ -78,12 +78,12 @@ jobs:
TEST_WARNING_MODE: fail
id: test

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Results
path: build/reports/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Heap Dump
Expand Down Expand Up @@ -112,12 +112,12 @@ jobs:
TEST_WARNING_MODE: fail
id: test

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} (${{ matrix.java }}) Results (Windows)
path: build/reports/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Heap Dump (Windows)
Expand All @@ -130,8 +130,8 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 17, 20 ]
os: [ windows-2022, ubuntu-22.04, macos-12 ]
java: [ 17, 21 ]
os: [ windows-2022, ubuntu-22.04, macos-14 ]

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -143,7 +143,7 @@ jobs:

- run: ./gradlew test --tests *ReproducibleBuildTest --stacktrace --warning-mode fail

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: Reproducible Build ${{ matrix.os }} (${{ matrix.java }}) Results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
@SuppressWarnings("unused")
public class LoomGradlePluginBootstrap implements Plugin<PluginAware> {
private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.3";
private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.6";
private static final int MIN_SUPPORTED_MAJOR_JAVA_VERSION = 17;
private static final int MIN_SUPPORTED_MAJOR_IDEA_VERSION = 2021;

Expand Down
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
}

group = "gg.essential"
def baseVersion = '1.5'
def baseVersion = '1.6'

def ENV = System.getenv()
def runNumber = ENV.GITHUB_RUN_NUMBER ?: "9999"
Expand Down Expand Up @@ -143,12 +143,13 @@ dependencies {
implementation libs.fabric.tiny.remapper
implementation libs.fabric.access.widener
implementation libs.fabric.mapping.io

implementation (libs.fabric.lorenz.tiny) {
transitive = false
}
implementation "dev.architectury:refmap-remapper:1.0.5"

implementation libs.fabric.loom.nativelib

// decompilers
fernflowerCompileOnly runtimeLibs.fernflower
fernflowerCompileOnly libs.fabric.mapping.io
Expand Down Expand Up @@ -282,6 +283,13 @@ checkstyle {
toolVersion = libs.versions.checkstyle.get()
}

// Workaround https://github.com/gradle/gradle/issues/27035
configurations.checkstyle {
resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
select("com.google.guava:guava:0")
}
}

codenarc {
toolVersion = libs.versions.codenarc.get()
configFile = file("codenarc.groovy")
Expand Down Expand Up @@ -374,6 +382,11 @@ task writeActionsTestMatrix() {
return
}

if (it.name.endsWith("DebugLineNumbersTest.groovy")) {
// Known flakey test
return
}

if (it.name.endsWith("FabricAPITest.groovy")) {
// Arch: Disabled as it hangs
return
Expand Down
14 changes: 8 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
[versions]
kotlin = "1.9.0"
kotlin = "1.9.20"
asm = "9.6"
commons-io = "2.15.1"
gson = "2.10.1"
guava = "33.0.0-jre"

stitch = "0.6.2"
tiny-remapper = "0.10.0"
tiny-remapper = "0.10.1"
access-widener = "2.1.0"
mapping-io = "0.5.1"
lorenz-tiny = "4.0.2"
mercury = "0.1.4.17"
kotlinx-metadata = "0.8.0"
kotlinx-metadata = "0.9.0"
loom-native = "0.2.0"

# Plugins
spotless = "6.20.0"
spotless = "6.25.0"
test-retry = "1.5.6"
checkstyle = "10.12.5"
codenarc = "3.3.0"
checkstyle = "10.13.0"
codenarc = "3.4.0"
jacoco = "0.8.11"

# Forge libraries
Expand Down Expand Up @@ -49,6 +50,7 @@ fabric-access-widener = { module = "net.fabricmc:access-widener", version.ref =
fabric-mapping-io = { module = "net.fabricmc:mapping-io", version.ref = "mapping-io" }
fabric-lorenz-tiny = { module = "net.fabricmc:lorenz-tiny", version.ref = "lorenz-tiny" }
fabric-mercury = { module = "dev.architectury:mercury", version.ref = "mercury" }
fabric-loom-nativelib = { module = "net.fabricmc:fabric-loom-native", version.ref = "loom-native" }

# Misc
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
Expand Down
6 changes: 4 additions & 2 deletions gradle/runtime.libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
# Decompilers
fernflower = "2.0.0"
cfr = "0.2.1"
cfr = "0.2.2"
vineflower = "1.9.3"

# Runtime depedencies
Expand All @@ -16,8 +16,9 @@ javax-annotations = "3.0.2"
forge-runtime = "2.0.9"
access-transformers = "3.0.1"
access-transformers-new = "8.0.5"
access-transformers-neo = "10.0.2"
unprotect = "1.2.0"
asm = "9.3"
asm = "9.7"
union-relauncher = "1.0.0"
access-transformers-log4j = "2.17.1"

Expand All @@ -41,6 +42,7 @@ naming-service = { module = "dev.architectury:architectury-naming-service", vers
mcp-annotations = { module = "dev.architectury:mcp-annotations", version.ref = "forge-runtime" }
access-transformers = { module = "net.minecraftforge:accesstransformers", version.ref = "access-transformers" }
access-transformers-new = { module = "net.minecraftforge:accesstransformers", version.ref = "access-transformers-new" }
access-transformers-neo = { module = "net.neoforged.accesstransformers:at-cli", version.ref = "access-transformers-neo" }
unprotect = { module = "io.github.juuxel:unprotect", version.ref = "unprotect" }
asm = { module = "org.ow2.asm:asm", version.ref = "asm" }
union-relauncher = { module = "io.github.juuxel:union-relauncher", version.ref = "union-relauncher" }
Expand Down
14 changes: 7 additions & 7 deletions gradle/test.libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
spock = "2.3-groovy-3.0"
junit = "5.10.1"
javalin = "5.6.3"
mockito = "5.8.0"
java-debug = "0.50.0"
mixin = "0.11.4+mixin.0.8.5"
junit = "5.10.2"
javalin = "6.1.0"
mockito = "5.10.0"
java-debug = "0.51.0"
mixin = "0.12.5+mixin.0.8.5"
pack200 = "0.1.3"

gradle-nightly = "8.7-20240104001326+0000"
fabric-loader = "0.15.3"
gradle-nightly = "8.8-20240224001421+0000"
fabric-loader = "0.15.6"
fabric-installer = "1.0.0"

[libraries]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.jetbrains.annotations.Nullable;
import org.objectweb.asm.signature.SignatureReader;
import org.objectweb.asm.util.CheckSignatureAdapter;

import net.fabricmc.loom.LoomGradlePlugin;
import net.fabricmc.loom.configuration.ifaceinject.InterfaceInjectionProcessor;
Expand Down Expand Up @@ -92,10 +94,25 @@ static List<InterfaceInjectionProcessor.InjectedInterface> getInjectedInterfaces
final List<InterfaceInjectionProcessor.InjectedInterface> result = new ArrayList<>();

for (String className : addedIfaces.keySet()) {
final JsonArray ifaceNames = addedIfaces.getAsJsonArray(className);
final JsonArray ifacesInfo = addedIfaces.getAsJsonArray(className);

for (JsonElement ifaceName : ifaceNames) {
result.add(new InterfaceInjectionProcessor.InjectedInterface(modId, className, ifaceName.getAsString()));
for (JsonElement ifaceElement : ifacesInfo) {
String ifaceInfo = ifaceElement.getAsString();

String name = ifaceInfo;
String generics = null;

if (ifaceInfo.contains("<") && ifaceInfo.contains(">")) {
name = ifaceInfo.substring(0, ifaceInfo.indexOf("<"));
generics = ifaceInfo.substring(ifaceInfo.indexOf("<"));

// First Generics Check, if there are generics, are them correctly written?
SignatureReader reader = new SignatureReader("Ljava/lang/Object" + generics + ";");
CheckSignatureAdapter checker = new CheckSignatureAdapter(CheckSignatureAdapter.CLASS_SIGNATURE, null);
reader.accept(checker);
}

result.add(new InterfaceInjectionProcessor.InjectedInterface(modId, className, name, generics));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public final class ModMetadataFiles {
.put(QuiltModJson.FILE_NAME, QuiltModJson::of)
.put(ArchitecturyCommonJson.FILE_NAME, ArchitecturyCommonJson::of)
.put(ModsToml.FILE_PATH, onError(ModsToml::of, "Could not load mods.toml", () -> new ErroringModMetadataFile("mods.toml")))
.put(ModsToml.NEOFORGE_FILE_PATH, onError(ModsToml::of, "Could not load neoforge.mods.toml", () -> new ErroringModMetadataFile("neoforge.mods.toml")))
.build();

private static <A, B> Function<A, B> onError(Function<A, B> fn, String message, Supplier<B> onError) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/dev/architectury/loom/metadata/ModsToml.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

public final class ModsToml implements ModMetadataFile {
public static final String FILE_PATH = "META-INF/mods.toml";
public static final String NEOFORGE_FILE_PATH = "META-INF/neoforge.mods.toml";
private final Config config;

private ModsToml(Config config) {
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/net/fabricmc/loom/LoomGradleExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package net.fabricmc.loom;

import java.nio.file.Path;
import java.util.Collection;
import java.util.List;

import org.gradle.api.Project;
Expand All @@ -46,6 +47,7 @@
import net.fabricmc.loom.configuration.providers.forge.PatchProvider;
import net.fabricmc.loom.configuration.providers.forge.SrgProvider;
import net.fabricmc.loom.configuration.providers.forge.mcpconfig.McpConfigProvider;
import net.fabricmc.loom.configuration.providers.mappings.LayeredMappingsFactory;
import net.fabricmc.loom.configuration.providers.mappings.MappingConfiguration;
import net.fabricmc.loom.configuration.providers.minecraft.MinecraftProvider;
import net.fabricmc.loom.configuration.providers.minecraft.library.LibraryProcessorManager;
Expand All @@ -54,6 +56,7 @@
import net.fabricmc.loom.configuration.providers.minecraft.mapped.NamedMinecraftProvider;
import net.fabricmc.loom.configuration.providers.minecraft.mapped.SrgMinecraftProvider;
import net.fabricmc.loom.extension.LoomFiles;
import net.fabricmc.loom.extension.LoomProblemReporter;
import net.fabricmc.loom.extension.MixinExtension;
import net.fabricmc.loom.extension.RemapperExtensionHolder;
import net.fabricmc.loom.util.ModPlatform;
Expand Down Expand Up @@ -105,7 +108,7 @@ default List<Path> getMinecraftJars(MappingsNamespace mappingsNamespace) {
return switch (mappingsNamespace) {
case NAMED -> getNamedMinecraftProvider().getMinecraftJarPaths();
case INTERMEDIARY -> getIntermediaryMinecraftProvider().getMinecraftJarPaths();
case OFFICIAL -> getMinecraftProvider().getMinecraftJars();
case OFFICIAL, CLIENT_OFFICIAL, SERVER_OFFICIAL -> getMinecraftProvider().getMinecraftJars();
case SRG -> {
ModPlatform.assertPlatform(this, ModPlatform.FORGE, () -> "SRG jars are only available on Forge.");
yield getSrgMinecraftProvider().getMinecraftJarPaths();
Expand Down Expand Up @@ -146,6 +149,10 @@ default List<Path> getMinecraftJars(MappingsNamespace mappingsNamespace) {

ListProperty<RemapperExtensionHolder> getRemapperExtensions();

Collection<LayeredMappingsFactory> getLayeredMappingFactories();

LoomProblemReporter getProblemReporter();

// ===================
// Architectury Loom
// ===================
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ private void declareRepositories(RepositoryHandler repositories, LoomFiles files
sources.artifact();
sources.ignoreGradleMetadataRedirection();
});

// Fallback to maven central for artifacts such as sources or javadocs that are not mirrored on Mojang's repo.
// See: https://github.com/FabricMC/fabric-loom/issues/1032
repo.artifactUrls(ArtifactRepositoryContainer.MAVEN_CENTRAL_URL);
});
repositories.maven(repo -> {
repo.setName("Forge");
Expand Down
Loading

0 comments on commit 1503992

Please sign in to comment.