-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
53 lines (45 loc) · 1.49 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "com.example" // TODO: Change this to your group
version = "1.0-SNAPSHOT" // TODO: Change this to your addon version
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.paperweight)
alias(libs.plugins.nova)
}
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 = project.name
name = project.name.replaceFirstChar(Char::uppercase)
version = project.version.toString()
novaVersion = libs.versions.nova
main = "com.example.ExampleAddon" // TODO: Change this to your main class
authors = listOf("ExampleAuthor") // TODO: Set your list of authors
}
tasks {
register<Copy>("addonJar") {
group = "build"
dependsOn("jar")
from(File(project.layout.buildDirectory.get().asFile, "libs/${project.name}-${project.version}.jar"))
into((project.findProperty("outDir") as? String)?.let(::File) ?: project.layout.buildDirectory.get().asFile)
rename { "${addonMetadata.get().addonName.get()}-${project.version}.jar" }
}
withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
}
}
}
afterEvaluate {
tasks.getByName<Jar>("jar") {
archiveClassifier = ""
}
}