This commit is contained in:
parent
f6763449f1
commit
6fa9824ef8
6 changed files with 58 additions and 37 deletions
|
@ -1,20 +1,20 @@
|
|||
import groovy.json.JsonGenerator.Options
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.gradleup.shadow") version "8.3.3"
|
||||
id("io.papermc.paperweight.userdev") version "1.7.3"
|
||||
id("com.gradleup.shadow") version "9.0.0-beta4"
|
||||
id("io.papermc.paperweight.userdev") version "2.0.0-beta.10"
|
||||
id("org.sonarqube") version "5.1.0.4882"
|
||||
}
|
||||
|
||||
group = "me.unurled"
|
||||
version = "0.1.2"
|
||||
version = "0.2.0"
|
||||
|
||||
val mcVersion = "1.21.1-R0.1-SNAPSHOT"
|
||||
val mcVersion = "1.21.4-R0.1-SNAPSHOT"
|
||||
val lampVersion = "4.0.0-beta.17"
|
||||
|
||||
val javaVersion = 21
|
||||
val javaVersion = 23
|
||||
|
||||
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@ -29,28 +29,14 @@ dependencies {
|
|||
}
|
||||
|
||||
java {
|
||||
val targetVersion = JavaVersion.toVersion(javaVersion)
|
||||
sourceCompatibility = targetVersion
|
||||
targetCompatibility = targetVersion
|
||||
if (JavaVersion.current() < targetVersion) {
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
|
||||
}
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
|
||||
}
|
||||
|
||||
tasks {
|
||||
assemble {
|
||||
dependsOn("reobfJar")
|
||||
}
|
||||
compileJava {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
|
||||
options.compilerArgs.add("-parameters")
|
||||
|
||||
if (javaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
|
||||
options.release.set(javaVersion)
|
||||
}
|
||||
options.release.set(javaVersion)
|
||||
sourceCompatibility = javaVersion.toString()
|
||||
targetCompatibility = javaVersion.toString()
|
||||
}
|
||||
sonar {
|
||||
properties {
|
||||
|
@ -59,10 +45,22 @@ tasks {
|
|||
}
|
||||
}
|
||||
javadoc {
|
||||
if (JavaVersion.current().isJava9Compatible) {
|
||||
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
|
||||
}
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
|
||||
}
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Jar>("sourcesJar") {
|
||||
archiveClassifier.set("sources")
|
||||
from(sourceSets["main"].allSource)
|
||||
}
|
||||
|
||||
tasks.register<Jar>("javadocJar") {
|
||||
archiveClassifier.set("javadoc")
|
||||
from(tasks.named("javadoc"))
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
@ -77,14 +75,29 @@ publishing {
|
|||
}
|
||||
}
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
groupId = project.group.toString()
|
||||
artifactId = project.name
|
||||
version = project.version.toString()
|
||||
from(components["java"])
|
||||
artifact(tasks.reobfJar) {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
artifact(tasks.shadowJar.get()) {
|
||||
classifier = ""
|
||||
}
|
||||
|
||||
artifact(tasks.named("sourcesJar").get())
|
||||
artifact(tasks.named("javadocJar").get())
|
||||
|
||||
pom {
|
||||
name.set(project.name)
|
||||
description.set(project.description)
|
||||
developers {
|
||||
developer {
|
||||
name.set("unurled")
|
||||
email.set("dev@unurled.me")
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection.set("scm:git:git://git.unurled.me/SacredRealms/SR-Core.git")
|
||||
developerConnection.set("scm:git:ssh://git.unurled.me:SacredRealms/SR-Core.git")
|
||||
url.set("https://git.unurled.me/SacredRealms/SR-Core")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue