From 48f7aa66fbd07abc0970420af325b9699d6e9cbf Mon Sep 17 00:00:00 2001 From: modmuss Date: Wed, 5 Nov 2025 13:49:09 +0000 Subject: [PATCH] Test compiling against the unobfuscated version. (#1423) --- .../test/integration/NotObfuscatedTest.groovy | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/NotObfuscatedTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/NotObfuscatedTest.groovy index d28ddc1e..23fcf39b 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/NotObfuscatedTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/NotObfuscatedTest.groovy @@ -24,6 +24,7 @@ package net.fabricmc.loom.test.integration +import org.intellij.lang.annotations.Language import spock.lang.Specification import spock.lang.Unroll @@ -39,10 +40,23 @@ class NotObfuscatedTest extends Specification implements GradleProjectTestTrait def gradle = gradleProject(project: "minimalBaseNoRemap", version: PRE_RELEASE_GRADLE) gradle.buildGradle << ''' dependencies { - minecraft 'com.mojang:minecraft:1.21.10' - api "net.fabricmc.fabric-api:fabric-api:0.134.1+1.21.10" + minecraft 'com.mojang:minecraft:25w45a_unobfuscated' } ''' + def sourceFile = new File(gradle.projectDir, "src/main/java/example/Test.java") + sourceFile.parentFile.mkdirs() + @Language("JAVA") String src = """ + package example; + + import net.minecraft.resources.Identifier; + + public class Test { + public static void main(String[] args) { + Identifier id = Identifier.fromNamespaceAndPath("loom", "test"); + } + } + """ + sourceFile.text = src when: def result = gradle.run(task: "build")