mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-20 15:26:51 +00:00
- 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
19 lines
885 B
Groovy
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}"))
|
|
}
|