Update build script
- increase development version of kspigot - update dependencies - cleanup buildscript
This commit is contained in:
@@ -2,47 +2,30 @@
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
/*
|
|
||||||
* BUILD CONSTANTS
|
|
||||||
*/
|
|
||||||
|
|
||||||
val GITHUB_REPO = "bluefireoly/KSpigot"
|
val GITHUB_REPO = "bluefireoly/KSpigot"
|
||||||
|
|
||||||
val JVM_VERSION = JavaVersion.VERSION_1_8
|
val jvmVersion = JavaVersion.VERSION_1_8
|
||||||
val JVM_VERSION_STRING = JVM_VERSION.versionString
|
val jvmVersionString = jvmVersion.majorVersion.let {
|
||||||
|
val version = it.toInt()
|
||||||
/*
|
if (version <= 10) "1.$it" else it
|
||||||
* PROJECT
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
group = "net.axay"
|
group = "net.axay"
|
||||||
version = "1.16.24"
|
version = "1.16.25"
|
||||||
|
|
||||||
description = "A Kotlin API for the Minecraft Server Software \"Spigot\"."
|
description = "A Kotlin API for the Minecraft Server Software \"Spigot\"."
|
||||||
|
|
||||||
/*
|
|
||||||
* PLUGINS
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
kotlin("jvm") version "1.4.31"
|
||||||
|
|
||||||
`java-library`
|
`java-library`
|
||||||
|
|
||||||
kotlin("jvm") version "1.4.30"
|
|
||||||
|
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
signing
|
signing
|
||||||
|
|
||||||
id("org.jetbrains.dokka") version "1.4.20"
|
id("org.jetbrains.dokka") version "1.4.30"
|
||||||
|
kotlin("plugin.serialization") version "1.4.31"
|
||||||
kotlin("plugin.serialization") version "1.4.21"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* DEPENDENCY MANAGEMENT
|
|
||||||
*/
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
@@ -51,35 +34,28 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
// SPIGOT
|
// SPIGOT
|
||||||
compileOnly("org.spigotmc", "spigot", "1.16.5-R0.1-SNAPSHOT")
|
compileOnly("org.spigotmc", "spigot", "1.16.5-R0.1-SNAPSHOT")
|
||||||
testCompileOnly("org.spigotmc", "spigot", "1.16.5-R0.1-SNAPSHOT")
|
testCompileOnly("org.spigotmc", "spigot", "1.16.5-R0.1-SNAPSHOT")
|
||||||
|
|
||||||
// KHTTP
|
|
||||||
api("khttp", "khttp", "1.0.0")
|
|
||||||
|
|
||||||
// ANVIL GUI
|
// ANVIL GUI
|
||||||
api("com.github.WesJD.AnvilGUI", "anvilgui", "master-SNAPSHOT")
|
api("com.github.WesJD.AnvilGUI", "anvilgui", "master-SNAPSHOT")
|
||||||
|
|
||||||
// KOTLINX
|
// KOTLINX
|
||||||
// serialization
|
// serialization
|
||||||
api("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.0.1")
|
api("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.1.0")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
java.sourceCompatibility = jvmVersion
|
||||||
* BUILD
|
java.targetCompatibility = jvmVersion
|
||||||
*/
|
|
||||||
|
|
||||||
java.sourceCompatibility = JVM_VERSION
|
|
||||||
java.targetCompatibility = JVM_VERSION
|
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
compileKotlin.configureJvmVersion()
|
compileKotlin.configureJvmVersion()
|
||||||
compileTestKotlin.configureJvmVersion()
|
compileTestKotlin.configureJvmVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun TaskProvider<KotlinCompile>.configureJvmVersion() { get().kotlinOptions.jvmTarget = jvmVersionString }
|
||||||
|
|
||||||
java {
|
java {
|
||||||
withSourcesJar()
|
withSourcesJar()
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
@@ -89,12 +65,7 @@ tasks.dokkaHtml.configure {
|
|||||||
outputDirectory.set(projectDir.resolve("docs"))
|
outputDirectory.set(projectDir.resolve("docs"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* PUBLISHING
|
|
||||||
*/
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://oss.sonatype.org/service/local/staging/deploy/maven2") {
|
maven("https://oss.sonatype.org/service/local/staging/deploy/maven2") {
|
||||||
credentials {
|
credentials {
|
||||||
@@ -106,7 +77,6 @@ publishing {
|
|||||||
|
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>(project.name) {
|
create<MavenPublication>(project.name) {
|
||||||
|
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
|
|
||||||
this.groupId = project.group.toString()
|
this.groupId = project.group.toString()
|
||||||
@@ -114,7 +84,6 @@ publishing {
|
|||||||
this.version = project.version.toString()
|
this.version = project.version.toString()
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
|
|
||||||
name.set(project.name)
|
name.set(project.name)
|
||||||
description.set(project.description)
|
description.set(project.description)
|
||||||
|
|
||||||
@@ -137,25 +106,11 @@ publishing {
|
|||||||
connection.set("scm:git:git://github.com/${GITHUB_REPO}.git")
|
connection.set("scm:git:git://github.com/${GITHUB_REPO}.git")
|
||||||
url.set("https://github.com/${GITHUB_REPO}/tree/main")
|
url.set("https://github.com/${GITHUB_REPO}/tree/main")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
sign(publishing.publications)
|
sign(publishing.publications)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* EXTENSIONS
|
|
||||||
*/
|
|
||||||
|
|
||||||
val JavaVersion.versionString get() = majorVersion.let {
|
|
||||||
val version = it.toInt()
|
|
||||||
if (version <= 10) "1.$it" else it
|
|
||||||
}
|
|
||||||
|
|
||||||
fun TaskProvider<KotlinCompile>.configureJvmVersion() { get().kotlinOptions.jvmTarget = JVM_VERSION_STRING }
|
|
||||||
|
Reference in New Issue
Block a user