Skip to content

Commit ec67e40

Browse files
committed
more test edits
1 parent 401e817 commit ec67e40

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/test/groovy/net/fabricmc/loom/test/integration/neoforge/NeoForge1205Test.groovy

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
3535
class NeoForge1205Test extends Specification implements GradleProjectTestTrait {
3636
@Unroll
3737
def "build #mcVersion #neoforgeVersion #mappings"() {
38+
if (Integer.valueOf(System.getProperty("java.version").split("\\.")[0] < 21)) return // Do not run this test with Java 17
39+
3840
setup:
3941
def gradle = gradleProject(project: "neoforge/12005", version: DEFAULT_GRADLE)
4042
gradle.buildGradle.text = gradle.buildGradle.text.replace('@MCVERSION@', mcVersion)
4143
.replace('@NEOFORGEVERSION@', neoforgeVersion)
42-
.replace('@MAPPINGS@', mappings)
44+
.replace('MAPPINGS', mappings) // Spotless doesn't like the @'s
4345

4446
when:
4547
def result = gradle.run(task: "build")

src/test/resources/projects/neoforge/12005/build.gradle

+7-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ repositories {
3838
dependencies {
3939
// To change the versions see the gradle.properties file
4040
minecraft "com.mojang:minecraft:$mcVersion"
41-
mappings loom.layered {
42-
it.mappings(@MAPPINGS@)
43-
it.mappings(rootProject.rootDir.toPath().resolve("23w13a.tiny").toFile())
41+
if ("@MAPPINGS@".equals("loom.officialMojangMappings()")) {
42+
mappings loom.officialMojangMappings();
43+
} else {
44+
mappings loom.layered {
45+
it.mappings(MAPPINGS)
46+
it.mappings(rootProject.rootDir.toPath().resolve("23w13a.tiny").toFile())
47+
}
4448
}
4549

4650
neoForge "net.neoforged:neoforge:$neoforgeVersion"

0 commit comments

Comments
 (0)