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
99 lines (84 loc) · 2.54 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "xyz.xenondevs"
version = "1.1"
val mojangMapped = project.hasProperty("mojang-mapped")
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.nova)
alias(libs.plugins.stringremapper)
alias(libs.plugins.specialsource)
`maven-publish`
}
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("simple_upgrades")
name.set("Simple Upgrades")
version.set(project.version.toString())
novaVersion.set(libs.versions.nova)
main.set("xyz.xenondevs.simpleupgrades.SimpleUpgrades")
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(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(" ", "-")) }
}
register<Jar>("sources") {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
from("src/main/kotlin")
archiveClassifier.set("sources")
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
}
publishing {
repositories {
maven {
credentials {
name = "xenondevs"
url = uri { "https://repo.xenondevs.xyz/releases/" }
credentials(PasswordCredentials::class)
}
}
}
publications {
create<MavenPublication>("SimpleUpgrades") {
from(components.getByName("kotlin"))
artifact(tasks.getByName("sources"))
}
}
}