pluginManagement { val weightVersion: String by settings repositories { gradlePluginPortal() mavenLocal() maven("https://repo.papermc.io/repository/maven-public/") maven("https://repo.bacteriawa.com/repository/maven-public/") } plugins { id("io.papermc.paperweight.patcher") version weightVersion id("io.papermc.paperweight.core") version weightVersion } } plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } rootProject.name = "shiroha" for (name in listOf("shiroha-api", "shiroha-server")) { include(name) file(name).mkdirs() } optionalInclude("test-plugin") optionalInclude("shiroha-generator") fun optionalInclude(name: String, op: (ProjectDescriptor.() -> Unit)? = null) { val settingsFile = file("$name.settings.gradle.kts") if (settingsFile.exists()) { apply(from = settingsFile) findProject(":$name")?.let { op?.invoke(it) } } else { settingsFile.writeText( """ // Uncomment to enable the '$name' project // include(":$name") """.trimIndent() ) } } gradle.lifecycle.beforeProject { val mcVersion = providers.gradleProperty("mcVersion").get().trim() val shirohaVersionChannel = providers.gradleProperty("channel").get().trim() val shirohaBuildNumber = providers.environmentVariable("BUILD_NUMBER").orNull?.trim()?.toInt() val versionString = if (shirohaBuildNumber == null) { "$mcVersion.local-SNAPSHOT" } else { "$mcVersion.build.$shirohaBuildNumber-${shirohaVersionChannel.lowercase()}" } version = versionString } include("FlowSched")