mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-21 07:46:55 +00:00
- Timeout overrides retain original values for restoration - Timeout restoration preserves operator changes and symbolic links - Tests cover timeout persistence and failed configuration writes - Runtime targets use separate Gradle caches and shared module outputs - Modded build inputs include test fixtures and runtime cache settings
24 lines
1.4 KiB
Groovy
24 lines
1.4 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}"
|
|
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)
|