diff options
author | Jason Penilla <[email protected]> | 2023-12-06 15:57:51 -0700 |
---|---|---|
committer | Jason Penilla <[email protected]> | 2023-12-06 15:57:51 -0700 |
commit | 10ee036217535524cb071930ccdc5e84c70cf2e1 (patch) | |
tree | f37019a4e1c8727e770d14de00a26b6b3f073e79 /settings.gradle.kts | |
parent | 813a64fcc838ec3795201c150287ed0808732957 (diff) | |
download | Paper-10ee036217535524cb071930ccdc5e84c70cf2e1.tar.gz Paper-10ee036217535524cb071930ccdc5e84c70cf2e1.zip |
Clean up settings script
Diffstat (limited to 'settings.gradle.kts')
-rw-r--r-- | settings.gradle.kts | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/settings.gradle.kts b/settings.gradle.kts index 9d90b914d6..f3117284e8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -44,19 +44,21 @@ for (name in listOf("Paper-API", "Paper-Server", "Paper-MojangAPI")) { findProject(":$projName")!!.projectDir = file(name) } -mapOf("test-plugin.settings.gradle.kts" to """ - // Uncomment to enable the test plugin module - // include(":test-plugin") - """.trimIndent(), - "paper-api-generator.settings.gradle.kts" to """ - // Uncomment to enable the api generator module - // include(":paper-api-generator") - """.trimIndent() -).forEach { (fileName, text) -> - val settingsFile = file(fileName) +optionalInclude("test-plugin") +optionalInclude("paper-api-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(text + "\n") + settingsFile.writeText( + """ + // Uncomment to enable the '$name' project + // include(":$name") + + """.trimIndent() + ) } } |