mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-23 16:44:06 +00:00
- Mod targets run through bounded Gradle workers with separate caches and daemon slots - Target logs retain verification failures and bounded output summaries - Nested tests use bounded forks and JVM thread counts - Lifecycle tests control deadlines through injected clocks
26 lines
1.5 KiB
Groovy
26 lines
1.5 KiB
Groovy
import groovy.json.JsonSlurper
|
|
|
|
boolean adapter = rootProject.name.startsWith('iris-')
|
|
File irisDirectory = adapter ? new File(settingsDir, '../..').canonicalFile : settingsDir
|
|
String minecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse('26.3')
|
|
Map<String, Map<String, Object>> modTargets = (Map<String, Map<String, Object>>) new JsonSlurper()
|
|
.parse(new File(irisDirectory, 'gradle/mod-targets.json'))
|
|
Map<String, Object> modTarget = modTargets.get(minecraftVersion)
|
|
if (modTarget == null) {
|
|
throw new GradleException("Unsupported Iris mod target ${minecraftVersion}; choose ${modTargets.keySet().join(', ')}")
|
|
}
|
|
String runtimeJava = providers.gradleProperty('irisRuntimeJava').getOrElse(modTarget.java.toString())
|
|
String variant = adapter ? "minecraft${minecraftVersion}-java${runtimeJava}" : "java${runtimeJava}"
|
|
if (!gradle.extensions.extraProperties.has('irisBuildLane')) {
|
|
File projectCacheRoot = gradle.startParameter.projectCacheDir ?: new File(settingsDir, '.gradle')
|
|
gradle.startParameter.projectCacheDir = new File(projectCacheRoot, variant)
|
|
}
|
|
|
|
String runtimeOutputVariant = runtimeJava == '21' ? 'java21/' : ''
|
|
if (adapter) {
|
|
runtimeOutputVariant = "modded/${rootProject.name}/${variant}/"
|
|
} else if (gradle.parent != null && gradle.parent.extensions.extraProperties.has('irisRuntimeOutputVariant')) {
|
|
runtimeOutputVariant = gradle.parent.extensions.extraProperties.get('irisRuntimeOutputVariant').toString()
|
|
}
|
|
gradle.extensions.extraProperties.set('irisRuntimeOutputVariant', runtimeOutputVariant)
|