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 4
/
Copy pathbuild.gradle.kts
76 lines (63 loc) · 2.05 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
71
72
73
74
75
76
import org.gradle.configurationcache.extensions.capitalized
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "xyz.xenondevs"
version = "0.4.3"
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)
implementation("xyz.xenondevs:simple-upgrades:1.0-SNAPSHOT")
}
addon {
id.set(project.name)
name.set(project.name.capitalized())
version.set(project.version.toString())
novaVersion.set(libs.versions.nova)
main.set("xyz.xenondevs.nova.machines.Machines")
depend.add("simple_upgrades")
authors.addAll("StudioCode", "ByteZ", "Javahase")
}
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())
}
generateWailaTextures {
filter.set { !it.name.contains(Regex("\\d")) }
}
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
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) ?: project.buildDir)
rename { it.replace(project.name, addon.get().addonName.get()) }
}
}