mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 14:35:11 +01:00
Clean up settings script
This commit is contained in:
parent
ada77b3a3b
commit
3b94cc3546
1 changed files with 13 additions and 11 deletions
|
@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue