Convert build scripts to Kotlin

Also added some new tasks to only build/install to maven local certain platforms
`buildMinecraft`, `installMinecraft`, `buildDiscord`, `installDiscord`, `buildIRC`, `installIRC`
This commit is contained in:
jmp 2020-12-31 21:26:53 -08:00 committed by Alexander Söderberg
parent d812ea633a
commit 2c188eb130
48 changed files with 519 additions and 499 deletions

View file

@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}

View file

@ -0,0 +1,29 @@
val versions = mapOf(
"checker-qual" to "3.8.0",
"geantyref" to "1.3.11",
"errorprone" to "2.4.0",
"errorprone_javac" to "9+181-r4173-1",
// DISCORD DEPENDENCIES
"javacord" to "3.1.1",
"jda" to "4.2.0_209",
// MINECRAFT DEPENDENCIES
"brigadier" to "1.0.17",
"bukkit" to "1.13.2-R0.1-SNAPSHOT",
"commodore" to "1.9",
"bungeecord" to "1.8-SNAPSHOT",
"cloudburst" to "1.0.0-SNAPSHOT",
"adventure-api" to "4.3.0",
"adventure-platform" to "4.0.0-SNAPSHOT",
"paper-api" to "1.15.2-R0.1-SNAPSHOT",
"velocity-api" to "1.1.0",
"jb-annotations" to "20.1.0",
"guava" to "21.0-jre",
// IRC DEPENDENCIES
"pircbotx" to "83a4c22e80",
// TEST DEPENDENCIES
"jupiter-engine" to "5.7.0",
"jhm" to "1.25.2"
)
val vers
get() = versions

View file

@ -0,0 +1,24 @@
import org.gradle.api.Project
import org.gradle.kotlin.dsl.invoke
fun Project.buildGroups(vararg groupNames: String) =
groupNames.forEach(this::buildGroup)
fun Project.buildGroup(groupName: String) {
tasks {
register("build$groupName") {
group = "cloud"
rootProject.subprojects
.filter { it.projectDir.parentFile.name == "cloud-${groupName.toLowerCase()}" }
.map { it.tasks.getByName("build") }
.forEach { dependsOn(it) }
}
register("install$groupName") {
group = "cloud"
rootProject.subprojects
.filter { it.projectDir.parentFile.name == "cloud-${groupName.toLowerCase()}" }
.map { it.tasks.getByName("publishToMavenLocal") }
.forEach { dependsOn(it) }
}
}
}