Files
Iris/adapters/forge/settings.gradle
T
Brian Neumann-Fopiano 516537db72 Forge Adapter
2026-06-12 02:48:22 -04:00

96 lines
3.0 KiB
Groovy

/*
* Iris is a World Generator for Minecraft Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import java.io.File
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'MinecraftForge'
url = uri('https://maven.minecraftforge.net/')
}
mavenCentral()
}
}
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}
rootProject.name = 'iris-forge'
dependencyResolutionManagement {
versionCatalogs {
libs {
from(files('../../gradle/libs.versions.toml'))
}
}
}
boolean hasVolmLibSettings(File directory) {
new File(directory, 'settings.gradle.kts').exists() || new File(directory, 'settings.gradle').exists()
}
File resolveLocalVolmLibDirectory() {
String configuredPath = providers.gradleProperty('localVolmLibDirectory')
.orElse(providers.environmentVariable('VOLMLIB_DIR'))
.orNull
if (configuredPath != null && !configuredPath.isBlank()) {
File configuredDirectory = file(configuredPath)
if (hasVolmLibSettings(configuredDirectory)) {
return configuredDirectory
}
}
File currentDirectory = settingsDir
while (currentDirectory != null) {
File candidate = new File(currentDirectory, 'VolmLib')
if (hasVolmLibSettings(candidate)) {
return candidate
}
currentDirectory = currentDirectory.parentFile
}
null
}
boolean useLocalVolmLib = providers.gradleProperty('useLocalVolmLib')
.orElse('true')
.map { String value -> value.equalsIgnoreCase('true') }
.get()
File localVolmLibDirectory = resolveLocalVolmLibDirectory()
if (useLocalVolmLib && localVolmLibDirectory != null) {
includeBuild(localVolmLibDirectory) {
dependencySubstitution {
substitute(module('com.github.VolmitSoftware:VolmLib')).using(project(':shared'))
substitute(module('com.github.VolmitSoftware.VolmLib:shared')).using(project(':shared'))
substitute(module('com.github.VolmitSoftware.VolmLib:volmlib-shared')).using(project(':shared'))
}
}
}
includeBuild('../..') {
dependencySubstitution {
substitute(module('art.arcane:core')).using(project(':core'))
substitute(module('art.arcane:spi')).using(project(':spi'))
}
}