Files
Iris/settings.gradle.kts
Brian Neumann-Fopiano d6bd5ec82f d
2026-02-18 20:24:25 -05:00

74 lines
2.5 KiB
Plaintext

/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2021 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
plugins {
id ("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
rootProject.name = "Iris"
fun hasVolmLibSettings(directory: File): Boolean {
return directory.resolve("settings.gradle.kts").exists() || directory.resolve("settings.gradle").exists()
}
fun resolveLocalVolmLibDirectory(): File? {
val configuredPath: String? = providers.gradleProperty("localVolmLibDirectory")
.orElse(providers.environmentVariable("VOLMLIB_DIR"))
.orNull
if (!configuredPath.isNullOrBlank()) {
val configuredDirectory: File = file(configuredPath)
if (hasVolmLibSettings(configuredDirectory)) {
return configuredDirectory
}
}
var currentDirectory: File? = settingsDir
while (currentDirectory != null) {
val candidate: File = currentDirectory.resolve("VolmLib")
if (hasVolmLibSettings(candidate)) {
return candidate
}
currentDirectory = currentDirectory.parentFile
}
return null
}
val useLocalVolmLib: Boolean = providers.gradleProperty("useLocalVolmLib")
.orElse("true")
.map { value: String -> value.equals("true", ignoreCase = true) }
.get()
val localVolmLibDirectory: File? = 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"))
}
}
}
include(":core", ":core:agent")
include(
":nms:v1_21_R7",
)