Files
Iris/gradle/mod-target.gradle
T
Brian Neumann-Fopiano 79e7b0c79e Chained mod target overlays
- Mod targets list an ordered overlay chain; later overlays replace earlier ones and earlier source replacements apply to inherited files
- Forge and NeoForge metadata take their loader version range from the target
- The Fabric permissions library is bundled only for targets that declare it
- Dropped the 1.21.1 mods.toml copies that only differed in the loader range
2026-10-16 10:44:12 -04:00

19 lines
885 B
Groovy

import groovy.json.JsonSlurper
File irisDirectory = project.name.startsWith('iris-') ? file('../..') : rootDir
String targetMinecraft = providers.gradleProperty('minecraftVersion').getOrElse('26.3')
Map<String, Map<String, Object>> targets = (Map<String, Map<String, Object>>) new JsonSlurper()
.parse(new File(irisDirectory, 'gradle/mod-targets.json'))
Map<String, Object> target = targets.get(targetMinecraft)
if (target == null) {
throw new GradleException("Unsupported Iris mod target ${targetMinecraft}; choose ${targets.keySet().join(', ')}")
}
targets.each { String minecraft, Map<String, Object> candidate ->
candidate.put('overlays', candidate.get('overlays') ?: [minecraft])
}
ext.irisModTarget = target
ext.irisModTargets = targets
if (project.name.startsWith('iris-')) {
layout.buildDirectory.set(layout.projectDirectory.dir("build/${targetMinecraft}"))
}