forked from Asleeepp/skript-oraxen
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
106 lines (85 loc) · 2.61 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
100
101
102
103
104
105
106
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
`java-library`
`maven-publish`
alias(libs.plugins.shadow)
alias(libs.plugins.run.paper)
kotlin("jvm")
}
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.skriptlang.org/releases")
maven("https://repo.nexomc.com/snapshots/")
}
java {
disableAutoTargetJvm()
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
description = "A skript addon that aims to link Nexo and Skript"
group = "me.asleepp"
version = "2.0.6"
dependencies {
compileOnly(libs.paper.api)
compileOnly(libs.lombok)
compileOnly(libs.nexo)
compileOnly(libs.skript)
implementation(libs.creative)
annotationProcessor(libs.lombok)
implementation(kotlin("stdlib-jdk8"))
}
tasks {
jar {
enabled = false
}
shadowJar {
archiveFileName.set("${rootProject.name}-${project.version}.jar")
archiveClassifier.set("")
manifest {
attributes["Implementation-Version"] = project.version
}
configurations = listOf(project.configurations.runtimeClasspath.get())
minimize()
relocate("team.unnamed.creative", "me.asleepp.skriptnexo.shadow.team.unnamed.creative")
}
assemble {
dependsOn(shadowJar)
}
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filter<ReplaceTokens>("tokens" to mapOf("version" to project.version))
inputs.property("version", project.version)
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}
defaultTasks("build")
// 1.8.8 - 1.16.5 = Java 8
// 1.17 = Java 16
// 1.18 - 1.20.4 = Java 17
// 1-20.5+ = Java 21
val version = "1.21.1"
val javaVersion = JavaLanguageVersion.of(21)
val jvmArgsExternal = listOf(
"-Dcom.mojang.eula.agree=true"
)
runServer {
minecraftVersion(version)
runDirectory.set(rootDir.resolve("run/paper/$version"))
javaLauncher.set(project.javaToolchains.launcherFor {
languageVersion.set(javaVersion)
})
downloadPlugins {
url("https://github.com/SkriptLang/Skript/releases/download/2.9.4/Skript-2.9.4.jar")
// Add your own plugins to download here, stick any that you can't download into the run folder this generates.
}
jvmArgs = jvmArgsExternal
}
}