This commit is contained in:
Brian Neumann-Fopiano
2026-07-30 12:31:39 -04:00
parent 0afbfcb7a2
commit 324cf9e095
374 changed files with 22705 additions and 25650 deletions
+27 -45
View File
@@ -16,60 +16,42 @@
* 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'))
}
}
}
apply from: new File(settingsDir, 'gradle/volmlib-resolution.settings.gradle')
include(':core', ':core:agent')
include(':probe')
include(':spi')
include(':adapters:bukkit:plugin')
include(':adapters:bukkit:nms:v26_2_R1')
/*
* Opt-in: surface the three modded adapter builds to the IDE.
*
* ./gradlew -PincludeModdedAdapters=true ...
*
* OFF by default, and deliberately so. Each adapter settings file does
* `includeBuild('../..')` back onto this build so it can substitute `art.arcane:core` and
* `art.arcane:spi` with the root projects. Including the adapters from here therefore closes a
* composite cycle (root -> adapter -> root) and registers the same VolmLib checkout from two
* participants at once. The release path does not need it: `fabricJar`/`forgeJar`/`neoforgeJar`
* invoke each adapter through its own wrapper as a standalone build (see build.gradle), which is
* also what keeps Loom, ForgeGradle, and ModDevGradle off one plugin classpath.
*
* Enable it only for IDE import, and expect to disable it again if Gradle rejects the cycle.
*/
boolean includeModdedAdapters = providers.gradleProperty('includeModdedAdapters')
.orElse('false')
.map { String value -> value.equalsIgnoreCase('true') }
.get()
if (includeModdedAdapters) {
includeBuild('adapters/fabric')
includeBuild('adapters/forge')
includeBuild('adapters/neoforge')
}