mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-01 18:24:06 +00:00
Merge upstream port lane d
NativeStructureWorldgenAccess keeps both sides: writes are still recorded for the stale deferred-record check, and they go through the POI reconciler when one is bound.
This commit is contained in:
commit
4b1d85177f
69 files changed
+2413
-255
No files matched your search
+87
-13
@@ -115,6 +115,7 @@ nmsBindings.each { key, value ->
|
||||
compileOnly(rootProject.libs.annotations)
|
||||
compileOnly(rootProject.libs.byteBuddy.core)
|
||||
testImplementation('junit:junit:4.13.2')
|
||||
testImplementation('org.mockito:mockito-core:5.23.0')
|
||||
testImplementation(project(':core'))
|
||||
testCompileOnly(volmLibCoordinate) {
|
||||
transitive = false
|
||||
@@ -289,9 +290,10 @@ tasks.register('buildBukkit', Copy) {
|
||||
}
|
||||
}
|
||||
|
||||
// The three loader jars come out of nested standalone Gradle builds driven through Exec. Their own
|
||||
// Gradle builds own the complete incremental model, so always launch them instead of allowing an
|
||||
// incomplete outer input inventory to publish stale jars.
|
||||
// The three loader jars come out of nested standalone Gradle builds driven through Exec. The outer
|
||||
// task therefore has to carry the full inventory of what those builds read: every shared source tree,
|
||||
// every build script and version file they load, and the local VolmLib checkout when the composite
|
||||
// resolves one. Anything missing from that list publishes a stale jar.
|
||||
Closure<File> resolveLocalVolmLibDirectory = { ->
|
||||
String configured = localVolmLibDirectory != null && !localVolmLibDirectory.isBlank()
|
||||
? localVolmLibDirectory
|
||||
@@ -324,25 +326,48 @@ List<Object> moddedSharedInputs = []
|
||||
'adapters/client-common/src',
|
||||
'core/src/main',
|
||||
'core/build.gradle',
|
||||
'core/volmlib-left-out-of-bukkit-jar.txt',
|
||||
'core/agent/src',
|
||||
'core/agent/build.gradle',
|
||||
'api/api/src',
|
||||
'api/api/build.gradle.kts',
|
||||
'api/host/src',
|
||||
'api/host/build.gradle.kts',
|
||||
'api/build.gradle.kts',
|
||||
'api/settings.gradle.kts',
|
||||
'module/src/main',
|
||||
'module/build.gradle.kts',
|
||||
'module/settings.gradle.kts',
|
||||
'module/gradle.properties',
|
||||
'module/lombok.config',
|
||||
'module/builtin-modules.txt',
|
||||
'spi/src/main',
|
||||
'spi/build.gradle',
|
||||
'build.gradle',
|
||||
'settings.gradle',
|
||||
'gradle.properties',
|
||||
'lombok.config',
|
||||
'gradle/libs.versions.toml',
|
||||
'gradle/volmlib-resolution.settings.gradle'
|
||||
'gradle/volmlib-resolution.settings.gradle',
|
||||
'gradle/irisapi-resolution.settings.gradle'
|
||||
].each { String path -> moddedSharedInputs.add(layout.projectDirectory.file(path).asFile) }
|
||||
File localVolmLibCheckout = useLocalVolmLib.equalsIgnoreCase('true') ? resolveLocalVolmLibDirectory() : null
|
||||
if (localVolmLibCheckout != null) {
|
||||
moddedSharedInputs.add(new File(localVolmLibCheckout, 'shared/src/main'))
|
||||
}
|
||||
|
||||
// The published VolmLib snapshot is resolved inside the nested build, so no outer input changes when it
|
||||
// moves. Without a local checkout the Exec tasks always run and the nested build decides what is stale.
|
||||
Closure<Void> rerunWhenVolmLibIsPublished = { Exec task ->
|
||||
if (localVolmLibCheckout == null) {
|
||||
task.outputs.upToDateWhen { false }
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Closure<Void> declareModdedJarIo = { Exec task, String adapter, String artifactName, Map<String, String> versions ->
|
||||
task.inputs.files(moddedSharedInputs).withPropertyName('moddedSharedSources')
|
||||
.withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
task.inputs.files(
|
||||
layout.projectDirectory.file("adapters/${adapter}/src").asFile,
|
||||
layout.projectDirectory.file("adapters/${adapter}/build.gradle").asFile,
|
||||
@@ -351,10 +376,8 @@ Closure<Void> declareModdedJarIo = { Exec task, String adapter, String artifactN
|
||||
versions.each { String key, String value -> task.inputs.property(key, value) }
|
||||
task.inputs.property('useLocalVolmLib', useLocalVolmLib)
|
||||
task.inputs.property('volmLibCoordinate', volmLibCoordinate)
|
||||
task.inputs.property('localVolmLibCheckout', localVolmLibCheckout == null ? '' : localVolmLibCheckout.absolutePath)
|
||||
task.outputs.file(layout.projectDirectory.file("adapters/${adapter}/build/libs/${artifactName}"))
|
||||
task.outputs.upToDateWhen { false }
|
||||
task.outputs.cacheIf { false }
|
||||
rerunWhenVolmLibIsPublished(task)
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -372,8 +395,8 @@ tasks.register('fabricJar', Exec) {
|
||||
"-PuseLocalVolmLib=${useLocalVolmLib}",
|
||||
"-PvolmLibCoordinate=${volmLibCoordinate}"
|
||||
]
|
||||
if (localVolmLibDirectory != null && !localVolmLibDirectory.isBlank()) {
|
||||
command.add("-PlocalVolmLibDirectory=${localVolmLibDirectory}")
|
||||
if (localVolmLibCheckout != null) {
|
||||
environment('ORG_GRADLE_PROJECT_localVolmLibDirectory', localVolmLibCheckout.absolutePath)
|
||||
}
|
||||
commandLine(command)
|
||||
declareModdedJarIo(it, 'fabric', fabricArtifactName, [
|
||||
@@ -410,8 +433,8 @@ tasks.register('forgeJar', Exec) {
|
||||
"-PuseLocalVolmLib=${useLocalVolmLib}",
|
||||
"-PvolmLibCoordinate=${volmLibCoordinate}"
|
||||
]
|
||||
if (localVolmLibDirectory != null && !localVolmLibDirectory.isBlank()) {
|
||||
command.add("-PlocalVolmLibDirectory=${localVolmLibDirectory}")
|
||||
if (localVolmLibCheckout != null) {
|
||||
environment('ORG_GRADLE_PROJECT_localVolmLibDirectory', localVolmLibCheckout.absolutePath)
|
||||
}
|
||||
commandLine(command)
|
||||
declareModdedJarIo(it, 'forge', forgeArtifactName, [
|
||||
@@ -448,8 +471,8 @@ tasks.register('neoforgeJar', Exec) {
|
||||
"-PuseLocalVolmLib=${useLocalVolmLib}",
|
||||
"-PvolmLibCoordinate=${volmLibCoordinate}"
|
||||
]
|
||||
if (localVolmLibDirectory != null && !localVolmLibDirectory.isBlank()) {
|
||||
command.add("-PlocalVolmLibDirectory=${localVolmLibDirectory}")
|
||||
if (localVolmLibCheckout != null) {
|
||||
environment('ORG_GRADLE_PROJECT_localVolmLibDirectory', localVolmLibCheckout.absolutePath)
|
||||
}
|
||||
commandLine(command)
|
||||
declareModdedJarIo(it, 'neoforge', neoForgeArtifactName, [
|
||||
@@ -486,6 +509,57 @@ 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 (localVolmLibCheckout != null) {
|
||||
environment('ORG_GRADLE_PROJECT_localVolmLibDirectory', localVolmLibCheckout.absolutePath)
|
||||
}
|
||||
commandLine(command)
|
||||
inputs.files(moddedSharedInputs).withPropertyName('moddedSharedSources')
|
||||
.withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
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)
|
||||
outputs.dir(layout.projectDirectory.dir('adapters/fabric/build/test-results/test'))
|
||||
rerunWhenVolmLibIsPublished(it)
|
||||
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 = [
|
||||
'art/arcane/iris/engine/IrisEngine.class',
|
||||
'art/arcane/iris/spi/IrisPlatform.class',
|
||||
|
||||
Reference in new issue
Block a user