SR-Core/build.gradle.kts
unurled 2f7de9a271
All checks were successful
publish / build (push) Successful in 2m57s
adding of Component util
2024-10-01 22:27:01 +02:00

74 lines
1.7 KiB
Kotlin

plugins {
`java-library`
`maven-publish`
id("io.papermc.paperweight.userdev") version "1.7.2"
id("org.sonarqube") version "5.1.0.4882"
}
group = "me.unurled"
version = "0.1.1"
val mcVersion = "1.21.1-R0.1-SNAPSHOT"
val javaVersion = 21
repositories {
mavenCentral()
}
dependencies {
paperweight.paperDevBundle(mcVersion)
}
java {
val targetVersion = JavaVersion.toVersion(javaVersion)
sourceCompatibility = targetVersion
targetCompatibility = targetVersion
if (JavaVersion.current() < targetVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
}
withJavadocJar()
withSourcesJar()
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
if (javaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release.set(javaVersion)
}
}
sonar {
properties {
property("sonar.projectKey", "SR-Core")
property("sonar.host.url", "https://qube.unurled.me")
}
}
javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
}
publishing {
repositories {
maven {
name = "repounurledme"
url = uri("https://repo.unurled.me/releases")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
}
}
}