mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 21:05:58 -05:00
Fix tests on newer Gradle versions (#979)
* Test against Gradle 8.5-rc1 * Test fixes for 8.5/8.6 * Spotless
This commit is contained in:
@@ -6,7 +6,7 @@ mockito = "5.4.0"
|
||||
java-debug = "0.48.0"
|
||||
mixin = "0.11.4+mixin.0.8.5"
|
||||
|
||||
gradle-nightly = "8.5-20230908221250+0000"
|
||||
gradle-nightly = "8.6-20231107135843+0000"
|
||||
fabric-loader = "0.14.22"
|
||||
fabric-installer = "0.11.1"
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import io.reactivex.functions.Function
|
||||
import spock.lang.Specification
|
||||
import spock.lang.Timeout
|
||||
|
||||
import net.fabricmc.loom.configuration.providers.minecraft.MinecraftJar
|
||||
import net.fabricmc.loom.test.util.GradleProjectTestTrait
|
||||
import net.fabricmc.loom.util.ZipUtils
|
||||
|
||||
@@ -138,7 +139,7 @@ class DebugLineNumbersTest extends Specification implements GradleProjectTestTra
|
||||
}
|
||||
|
||||
private static String getClassSource(GradleProject gradle, String classname, String mappings = MAPPINGS) {
|
||||
File sourcesJar = gradle.getGeneratedSources(mappings, "serveronly")
|
||||
File sourcesJar = gradle.getGeneratedSources(mappings, MinecraftJar.Server.NAME)
|
||||
return new String(ZipUtils.unpack(sourcesJar.toPath(), classname), StandardCharsets.UTF_8)
|
||||
}
|
||||
|
||||
|
||||
@@ -33,29 +33,34 @@ import static net.fabricmc.loom.test.LoomTestConstants.STANDARD_TEST_VERSIONS
|
||||
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
|
||||
|
||||
class MultiMcVersionTest extends Specification implements GradleProjectTestTrait {
|
||||
static def versions = [
|
||||
'fabric-1.14.4',
|
||||
'fabric-1.15',
|
||||
'fabric-1.15.2',
|
||||
'fabric-1.16',
|
||||
'fabric-1.16.5',
|
||||
'fabric-1.17',
|
||||
'fabric-1.17.1',
|
||||
'fabric-1.18',
|
||||
'fabric-1.18.2',
|
||||
'fabric-1.19',
|
||||
'fabric-1.19.3'
|
||||
]
|
||||
|
||||
@Unroll
|
||||
def "build (gradle #version)"() {
|
||||
setup:
|
||||
def gradle = gradleProject(project: "multi-mc-versions", version: version)
|
||||
|
||||
versions.forEach {
|
||||
// Make dir as its now required by Gradle
|
||||
new File(gradle.projectDir, it).mkdir()
|
||||
}
|
||||
|
||||
when:
|
||||
def result = gradle.run(tasks: "build")
|
||||
|
||||
then:
|
||||
def versions = [
|
||||
'fabric-1.14.4',
|
||||
'fabric-1.15',
|
||||
'fabric-1.15.2',
|
||||
'fabric-1.16',
|
||||
'fabric-1.16.5',
|
||||
'fabric-1.17',
|
||||
'fabric-1.17.1',
|
||||
'fabric-1.18',
|
||||
'fabric-1.18.2',
|
||||
'fabric-1.19',
|
||||
'fabric-1.19.3'
|
||||
]
|
||||
|
||||
result.task(":build").outcome == SUCCESS
|
||||
versions.forEach {
|
||||
result.task(":$it:build").outcome == SUCCESS
|
||||
|
||||
Reference in New Issue
Block a user