This repository has been archived by the owner on Sep 24, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
70 lines (57 loc) · 1.78 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "xyz.xenondevs"
version = "1.2"
val mojangMapped = project.hasProperty("mojang-mapped")
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.nova)
alias(libs.plugins.stringremapper)
alias(libs.plugins.specialsource)
}
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.xenondevs.xyz/releases")
// include xenondevs-nms repository if requested
if (project.hasProperty("xenondevsNms")) {
maven("https://repo.papermc.io/repository/maven-public/") // authlib, brigadier, etc.
maven {
name = "xenondevsNms"
url = uri("https://repo.xenondevs.xyz/nms/")
credentials(PasswordCredentials::class)
}
}
}
dependencies {
implementation(libs.nova)
}
addon {
id.set(project.name)
name.set("Vanilla Hammers")
version.set(project.version.toString())
novaVersion.set(libs.versions.nova)
main.set("xyz.xenondevs.vanillahammers.VanillaHammers")
authors.add("StudioCode")
}
spigotRemap {
spigotVersion.set(libs.versions.spigot.get().substringBefore('-'))
sourceJarTask.set(tasks.jar)
}
remapStrings {
remapGoal.set(if (mojangMapped) "mojang" else "spigot")
spigotVersion.set(libs.versions.spigot.get())
}
tasks {
register<Copy>("addonJar") {
group = "build"
dependsOn("addon", if (mojangMapped) "jar" else "remapObfToSpigot")
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"
}
}
}