Skip to content
This repository has been archived by the owner on Sep 24, 2023. It is now read-only.

Commit

Permalink
Update gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Jun 7, 2023
1 parent e68817c commit 081d3bc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
27 changes: 9 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "xyz.xenondevs"
version = "1.1"

val mojangMapped = project.hasProperty("mojang-mapped") || System.getProperty("mojang-mapped") != null
val mojangMapped = project.hasProperty("mojang-mapped")

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
kotlin("jvm") version "1.8.20"
id("xyz.xenondevs.specialsource-gradle-plugin") version "1.0.0"
id("xyz.xenondevs.string-remapper-gradle-plugin") version "1.0"
id("xyz.xenondevs.nova.nova-gradle-plugin") version libs.versions.nova
alias(libs.plugins.kotlin)
alias(libs.plugins.nova)
alias(libs.plugins.stringremapper)
alias(libs.plugins.specialsource)
}

repositories {
Expand All @@ -21,7 +20,6 @@ repositories {

dependencies {
implementation(libs.nova)
implementation(variantOf(libs.spigot) { classifier("remapped-mojang") })
}

addon {
Expand All @@ -38,30 +36,23 @@ addon {
spigotRemap {
spigotVersion.set(libs.versions.spigot.get().substringBefore('-'))
sourceJarTask.set(tasks.jar)
spigotJarClassifier.set("")
}

remapStrings {
remapGoal.set(if (mojangMapped) "mojang" else "spigot")
spigotVersion.set(libs.versions.spigot.get())
classes.set(listOf(
// Put your classes to string-remap here
))
}

tasks {
register<Copy>("addonJar") {
group = "build"
dependsOn("addon", if (mojangMapped) "jar" else "remapObfToSpigot")

from(File(File(project.buildDir, "libs"), "${project.name}-${project.version}.jar"))
into(
(project.findProperty("outDir") as? String)?.let(::File)
?: System.getProperty("outDir")?.let(::File)
?: project.buildDir
)
rename { it.replace(project.name, addon.get().addonName.get().replace(" ", "-")) }
from(File(project.buildDir, "libs/${project.name}-${project.version}.jar"))
into((project.findProperty("outDir") as? String)?.let(::File) ?: project.buildDir)
rename { it.replace(project.name, "Vanilla-Hammers") }
}

withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
7 changes: 6 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ dependencyResolutionManagement {
create("libs") {
version("nova", "0.13")
version("spigot", "1.19.4-R0.1-SNAPSHOT")
version("kotlin", "1.8.20")

plugin("kotlin", "org.jetbrains.kotlin.jvm").versionRef("kotlin")
plugin("nova", "xyz.xenondevs.nova.nova-gradle-plugin").versionRef("nova")
plugin("stringremapper", "xyz.xenondevs.string-remapper-gradle-plugin").version("1.3")
plugin("specialsource", "xyz.xenondevs.specialsource-gradle-plugin").version("1.1")

library("nova", "xyz.xenondevs.nova", "nova").versionRef("nova")
library("spigot", "org.spigotmc", "spigot").versionRef("spigot")
}
}
}
Expand Down

0 comments on commit 081d3bc

Please sign in to comment.