-
-
Notifications
You must be signed in to change notification settings - Fork 100
/
build.gradle.kts
98 lines (82 loc) · 2.87 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
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "com.iridium"
version = "4.1.0"
description = "IridiumSkyblock"
repositories {
mavenCentral()
mavenLocal()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://ci.ender.zone/plugin/repository/everything/")
maven("https://nexus.iridiumdevelopment.net/repository/maven-releases/")
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://jitpack.io")
maven("https://maven.enginehub.org/repo/")
}
dependencies {
// Dependencies that we want to shade in
implementation("org.jetbrains:annotations:24.1.0")
implementation("com.j256.ormlite:ormlite-core:6.1")
implementation("com.j256.ormlite:ormlite-jdbc:6.1")
implementation("com.iridium:IridiumTeams:2.5.7")
// Other dependencies that are not required or already available at runtime
compileOnly("org.projectlombok:lombok:1.18.34")
compileOnly("org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")
compileOnly("net.ess3:EssentialsXSpawn:2.16.1")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.13-SNAPSHOT")
// Enable lombok annotation processing
annotationProcessor("org.projectlombok:lombok:1.18.34")
}
tasks {
// "Replace" the build task with the shadowJar task (probably bad but who cares)
jar {
dependsOn("shadowJar")
enabled = false
}
shadowJar {
fun relocate(origin: String) =
relocate(origin, "com.iridium.iridiumskyblock.dependencies${origin.substring(origin.lastIndexOf('.'))}")
// Remove the archive classifier suffix
archiveClassifier.set("")
// Relocate dependencies
relocate("com.iridium.iridiumcore")
relocate("com.j256.ormlite")
relocate("org.bstats")
relocate("de.jeff_media.updatechecker")
// Remove unnecessary files from the jar
minimize()
}
// Set UTF-8 as the encoding
compileJava {
options.encoding = "UTF-8"
}
// Process Placeholders for the plugin.yml
processResources {
filesMatching("**/plugin.yml") {
expand(rootProject.project.properties)
}
// Always re-run this task
outputs.upToDateWhen { false }
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
}
// Maven publishing
publishing {
publications.create<MavenPublication>("maven") {
setGroupId("com.iridium")
setArtifactId("IridiumSkyblock")
setVersion(version)
artifact(tasks["shadowJar"])
}
}