Clean up build script

This commit is contained in:
Ryder Belserion 2023-02-28 01:24:26 -05:00
parent 8bce928446
commit b64e667ef0
No known key found for this signature in database
GPG Key ID: 8FC2E6C54BBF05FE
3 changed files with 17 additions and 41 deletions

View File

@ -1,18 +0,0 @@
plugins {
`java-library`
`maven-publish`
id("com.github.hierynomus.license")
id("com.github.johnrengelman.shadow")
}
license {
header = rootProject.file("LICENSE")
encoding = "UTF-8"
mapping("java", "JAVADOC_STYLE")
include("**/*.java")
}

View File

@ -1,15 +0,0 @@
import gradle.kotlin.dsl.accessors._8aa390c341e35d66485a63bc7873c757.java
import org.gradle.api.JavaVersion
plugins {
id("crazyauctions.root-plugin")
}
repositories {
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@ -24,7 +24,9 @@ val lowerCase = rootProject.name.lowercase()
include("core")
project(":core").name = "$lowerCase-core"
listOf("spigot").forEach(::includePlatform)
listOf("platforms").forEach(::includeProject)
listOf("paper").forEach(::includePlatform)
fun includeProject(name: String) {
include(name) {
@ -32,13 +34,6 @@ fun includeProject(name: String) {
}
}
fun includePlatform(name: String) {
include(name) {
this.name = "$lowerCase-platform-$name"
this.projectDir = file("platforms/$name")
}
}
fun includeModule(name: String) {
include(name) {
this.name = "$lowerCase-module-$name"
@ -46,6 +41,13 @@ fun includeModule(name: String) {
}
}
fun includePlatform(name: String) {
include(name) {
this.name = "$lowerCase-$name"
this.projectDir = file("platforms/$name")
}
}
fun includePlatformModule(name: String, platform: String) {
include(name) {
this.name = "$lowerCase-module-$platform-$name"
@ -53,6 +55,13 @@ fun includePlatformModule(name: String, platform: String) {
}
}
fun includeDiscordType(name: String) {
include(name) {
this.name = "$lowerCase-$name"
this.projectDir = file("platforms/discord/$name")
}
}
fun include(name: String, block: ProjectDescriptor.() -> Unit) {
include(name)
project(":$name").apply(block)