Run modded and buildSrc tests

- Add a root moddedTest that runs adapters/modded-common through the Fabric build
- Make check depend on moddedTest, ordered ahead of the loader jars
- Gate the buildSrc jar on the buildSrc tests so they stop being skipped
- Drop an unreachable classpath guard from SchemaBuilderPlatformIsolationTest
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-08 03:41:15 -04:00
1 parent 89dc5d0447
commit 7841efed54
3 files changed
+56 -3

No files matched your search

+50
View File
@@ -446,6 +446,56 @@ tasks.named('neoforgeJar').configure {
mustRunAfter(tasks.named('forgeJar'))
}
// adapters/modded-common has no build of its own: its sources are compiled by each loader wrapper, so
// its tests only run when one of those wrappers is asked for `test`. The Fabric wrapper is the one
// that runs them as plain JUnit - NeoForge's moddev unit-test harness boots the mod through FML's
// transforming class loader and dies on a split-package ServiceConfigurationError before any test
// starts. One loader is enough: the sources are identical across all three.
tasks.register('moddedTest', Exec) {
group = 'verification'
description = 'Runs the adapters/modded-common test suite through the Fabric adapter build.'
workingDir = layout.projectDirectory.dir('adapters/fabric').asFile
String wrapperScript = System.getProperty('os.name').toLowerCase().contains('windows') ? 'gradlew.bat' : 'gradlew'
List<String> command = [
layout.projectDirectory.file(wrapperScript).asFile.absolutePath,
'test',
'--console=plain',
"-PirisVersion=${project.version}",
"-PminecraftVersion=${minecraftVersion}",
"-PfabricLoaderVersion=${fabricLoaderVersion}",
"-PuseLocalVolmLib=${useLocalVolmLib}",
"-PvolmLibCoordinate=${volmLibCoordinate}"
]
if (localVolmLibDirectory != null && !localVolmLibDirectory.isBlank()) {
command.add("-PlocalVolmLibDirectory=${localVolmLibDirectory}")
}
commandLine(command)
inputs.files(moddedSharedInputs).withPropertyName('moddedSharedSources')
inputs.files(
layout.projectDirectory.file('adapters/fabric/src').asFile,
layout.projectDirectory.file('adapters/fabric/build.gradle').asFile,
layout.projectDirectory.file('adapters/fabric/settings.gradle').asFile
).withPropertyName('adapterSources')
inputs.property('irisVersion', project.version.toString())
inputs.property('minecraftVersion', minecraftVersion)
inputs.property('fabricLoaderVersion', fabricLoaderVersion)
inputs.property('useLocalVolmLib', useLocalVolmLib)
inputs.property('volmLibCoordinate', volmLibCoordinate)
inputs.property('localVolmLibCheckout', localVolmLibCheckout == null ? '' : localVolmLibCheckout.absolutePath)
outputs.dir(layout.projectDirectory.dir('adapters/fabric/build/test-results/test'))
mustRunAfter(tasks.named('jar'))
mustRunAfter(project(':core').tasks.named('check'))
mustRunAfter(project(':spi').tasks.named('jar'))
}
tasks.named('fabricJar').configure {
mustRunAfter(tasks.named('moddedTest'))
}
tasks.named('check').configure {
dependsOn('moddedTest')
}
List<String> commonModdedArtifactEntries = [
'META-INF/iris/generation-kernels/catalog.tsv',
'META-INF/iris/generation-kernels/abi-1.revision',