74 lines
1.7 KiB
Kotlin
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"])
|
|
}
|
|
}
|
|
}
|