From ebb673d5d26ccbc17a1b680f4355a78456ed7af2 Mon Sep 17 00:00:00 2001 From: Jakob K <52456572+bluefireoly@users.noreply.github.com> Date: Wed, 12 May 2021 13:54:11 +0200 Subject: [PATCH] Improve buildscript --- build.gradle.kts | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e7024754..11187e93 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,14 +1,6 @@ -@file:Suppress("PropertyName") - import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -val GITHUB_REPO = "bluefireoly/KSpigot" - -val jvmVersion = JavaVersion.VERSION_1_8 -val jvmVersionString = jvmVersion.majorVersion.let { - val version = it.toInt() - if (version <= 10) "1.$it" else it -} +val githubRepo = "bluefireoly/KSpigot" group = "net.axay" version = "1.16.26" @@ -43,23 +35,28 @@ dependencies { api("org.json", "json", "20210307") } -java.sourceCompatibility = jvmVersion -java.targetCompatibility = jvmVersion - tasks { - compileKotlin.configureJvmVersion() - compileTestKotlin.configureJvmVersion() -} + withType { + options.encoding = "UTF-8" + options.release.set(8) + } -fun TaskProvider.configureJvmVersion() { get().kotlinOptions.jvmTarget = jvmVersionString } + withType { + kotlinOptions.jvmTarget = "1.8" + } + + dokkaHtml.configure { + outputDirectory.set(projectDir.resolve("docs")) + } +} java { withSourcesJar() withJavadocJar() } -tasks.dokkaHtml.configure { - outputDirectory.set(projectDir.resolve("docs")) +signing { + sign(publishing.publications) } publishing { @@ -91,21 +88,17 @@ publishing { licenses { license { name.set("The Apache License, Version 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") } } - url.set("https://github.com/${GITHUB_REPO}") + url.set("https://github.com/${githubRepo}") scm { - connection.set("scm:git:git://github.com/${GITHUB_REPO}.git") - url.set("https://github.com/${GITHUB_REPO}/tree/main") + connection.set("scm:git:git://github.com/${githubRepo}.git") + url.set("https://github.com/${githubRepo}/tree/main") } } } } } - -signing { - sign(publishing.publications) -}