generated from xenondevs/Nova-Addon-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
62 lines (52 loc) · 1.7 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
import org.gradle.configurationcache.extensions.capitalized
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "io.cerebus.ironchests"
version = "0.1-alpha"
val mojangMapped = project.hasProperty("mojang-mapped")
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.paperweight)
alias(libs.plugins.nova)
alias(libs.plugins.stringremapper)
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://repo.xenondevs.xyz/releases")
}
dependencies {
paperweight.paperDevBundle(libs.versions.paper)
implementation(libs.nova)
}
addon {
id.set(project.name)
name.set(project.name.capitalized())
version.set(project.version.toString())
novaVersion.set(libs.versions.nova)
main.set("io.cerebus.ironchests.IronChests")
authors.add("CraftCoderr")
}
remapStrings {
remapGoal.set(if (mojangMapped) "mojang" else "spigot")
gameVersion.set(libs.versions.paper.get().substringBefore("-"))
}
tasks {
register<Copy>("addonJar") {
group = "build"
if (mojangMapped) {
dependsOn("jar")
from(File(buildDir, "libs/${project.name}-${project.version}-dev.jar"))
} else {
dependsOn("reobfJar")
from(File(buildDir, "libs/${project.name}-${project.version}.jar"))
}
from(File(project.buildDir, "libs/${project.name}-${project.version}.jar"))
into((project.findProperty("outDir") as? String)?.let(::File) ?: project.buildDir)
rename { "${addonMetadata.get().addonName.get()}-${project.version}.jar" }
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
}