forked from NotAlexNoyle/DuelEnhancer-OG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
91 lines (73 loc) · 2.42 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
plugins {
id("com.gradleup.shadow") version "8.3.5" // Import shadow API.
java // Tell gradle this is a java project.
eclipse // Import eclipse plugin for IDE integration.
kotlin("jvm") version "2.0.21" // Import kotlin jvm plugin for kotlin/java integration.
}
java {
// Declare java version.
sourceCompatibility = JavaVersion.VERSION_17
}
group = "net.trueog.duelenhancer-og" // Declare bundle identifier.
version = "1.1" // Declare plugin version (will be in .jar).
val apiVersion = "1.19" // Declare minecraft server target version.
tasks.named<ProcessResources>("processResources") {
val props = mapOf(
"version" to version,
"apiVersion" to apiVersion
)
inputs.properties(props) // Indicates to rerun if version changes.
filesMatching("plugin.yml") {
expand(props)
}
}
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://repo.purpurmc.org/snapshots") // Import the PurpurMC Maven Repository.
}
maven {
url = uri("https://jitpack.io") // Import Jitpack repository for Duels API.
}
}
dependencies {
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare purpur API version to be packaged.
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.2.3") // Import MiniPlaceholders API.
compileOnly("com.github.Realizedd.Duels:duels-api:3.5.1") // Build the Duels API.
implementation(project(":libs:Utilities-OG"))
implementation(project(":libs:GxUI-OG"))
}
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible builds.
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
tasks.shadowJar {
archiveClassifier.set("") // Use empty string instead of null
from("LICENSE") {
into("/")
}
exclude("io.github.miniplaceholders.*") // Exclude the MiniPlaceholders package from being shadowed.
minimize()
}
tasks.build {
dependsOn(tasks.shadowJar)
}
tasks.jar {
archiveClassifier.set("part")
}
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("-parameters")
options.compilerArgs.add("-Xlint:deprecation") // Triggers deprecation warning messages.
options.encoding = "UTF-8"
options.isFork = true
}
kotlin {
jvmToolchain(17)
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.GRAAL_VM
}
}