mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-03 06:16:19 +00:00
73 lines
2.5 KiB
Groovy
73 lines
2.5 KiB
Groovy
/*
|
|
* 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'
|
|
|
|
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'))
|
|
}
|
|
}
|
|
}
|
|
|
|
include(':core', ':core:agent')
|
|
include(':nms:v1_21_R7')
|