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 {
|
plugins {
|
||||||
`java-library`
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.gradleup.shadow") version "8.3.3"
|
id("com.gradleup.shadow") version "9.0.0-beta4"
|
||||||
id("io.papermc.paperweight.userdev") version "1.7.3"
|
id("io.papermc.paperweight.userdev") version "2.0.0-beta.10"
|
||||||
id("org.sonarqube") version "5.1.0.4882"
|
id("org.sonarqube") version "5.1.0.4882"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "me.unurled"
|
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 lampVersion = "4.0.0-beta.17"
|
||||||
|
|
||||||
val javaVersion = 21
|
val javaVersion = 23
|
||||||
|
|
||||||
|
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@ -29,28 +29,14 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
val targetVersion = JavaVersion.toVersion(javaVersion)
|
|
||||||
sourceCompatibility = targetVersion
|
|
||||||
targetCompatibility = targetVersion
|
|
||||||
if (JavaVersion.current() < targetVersion) {
|
|
||||||
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
|
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
|
||||||
}
|
}
|
||||||
withJavadocJar()
|
|
||||||
withSourcesJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
assemble {
|
|
||||||
dependsOn("reobfJar")
|
|
||||||
}
|
|
||||||
compileJava {
|
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 {
|
sonar {
|
||||||
properties {
|
properties {
|
||||||
|
@ -59,12 +45,24 @@ tasks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
javadoc {
|
javadoc {
|
||||||
if (JavaVersion.current().isJava9Compatible) {
|
options.encoding = Charsets.UTF_8.name()
|
||||||
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
|
(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 {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
|
@ -77,14 +75,29 @@ publishing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("maven") {
|
create<MavenPublication>("mavenJava") {
|
||||||
groupId = project.group.toString()
|
artifact(tasks.shadowJar.get()) {
|
||||||
artifactId = project.name
|
|
||||||
version = project.version.toString()
|
|
||||||
from(components["java"])
|
|
||||||
artifact(tasks.reobfJar) {
|
|
||||||
classifier = ""
|
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")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
org.gradle.parallel=true
|
||||||
|
org.gradle.caching=true
|
||||||
|
org.gradle.configuration-cache=true
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
5
gradlew
vendored
5
gradlew
vendored
|
@ -15,6 +15,8 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
|
@ -84,7 +86,8 @@ done
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|
2
gradlew.bat
vendored
2
gradlew.bat
vendored
|
@ -13,6 +13,8 @@
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue