-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
179 lines (156 loc) · 5.14 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import io.papermc.hangarpublishplugin.model.Platforms
plugins {
id("com.gradleup.shadow") version "8.3.3"
java
`maven-publish`
alias(libs.plugins.hangar)
id("de.chojo.publishdata") version "1.4.0"
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
id("xyz.jpenilla.run-paper") version "2.3.1"
}
repositories {
mavenCentral()
maven("https://eldonexus.de/repository/maven-public")
maven("https://eldonexus.de/repository/maven-proxies")
maven("https://raw.githubusercontent.com/FabioZumbi12/RedProtect/mvn-repo/")
maven("https://raw.githubusercontent.com/FabioZumbi12/UltimateChat/mvn-repo/")
maven("https://maven.citizensnpcs.co/repo")
maven("https://jitpack.io")
maven("https://repo.glaremasters.me/repository/towny/")
}
group = "de.eldoria"
version = "1.3.14"
var mainPackage = "pickmeup"
val shadebase = group as String? + "." + mainPackage + "."
dependencies {
bukkitLibrary(libs.bundles.eldoria.utilities)
implementation(libs.bstats)
compileOnly(libs.spigot.v16)
compileOnly("com.mojang", "authlib", "1.5.25")
compileOnly(libs.jetbrains.annotations)
compileOnly("net.citizensnpcs", "citizens-main", "2.0.30-SNAPSHOT") {
exclude("*")
}
compileOnly("world.bentobox", "bentobox", "2.3.0-SNAPSHOT")
compileOnly("com.github.TechFortress", "GriefPrevention", "17.0.0")
compileOnly("com.palmergames.bukkit.towny", "towny", "0.100.4.4")
compileOnly("com.plotsquared", "PlotSquared-Core", "6.11.1") {
exclude("*")
}
compileOnly("com.plotsquared", "PlotSquared-Bukkit", "6.11.1") { isTransitive = false } // PlotSquared Bukkit API
compileOnly("io.github.fabiozumbi12.RedProtect", "RedProtect-Core", "8.1.2") {
exclude("*")
}
compileOnly("io.github.fabiozumbi12.RedProtect", "RedProtect-Spigot", "8.1.1") {
exclude("com.github.MilkBowl")
exclude("com.github.TheBusyBiscuit")
exclude("com.gmail.nossr50.mcMMO")
exclude("net.ess3")
exclude("org.spigotmc")
exclude("org.spongepowered")
exclude("com.typesafe")
}
testImplementation(libs.bundles.eldoria.utilities)
testImplementation(platform("org.junit:junit-bom:5.11.2"))
testImplementation("org.junit.jupiter", "junit-jupiter")
testImplementation("org.spigotmc", "spigot-api", "1.16.5-R0.1-SNAPSHOT")
testImplementation("com.github.seeseemelk", "MockBukkit-v1.16", "1.5.2")
}
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
publishData {
useEldoNexusRepos()
publishComponent("java")
}
publishing {
publications.create<MavenPublication>("maven") {
publishData.configurePublication(this)
}
repositories {
maven {
authentication {
credentials(PasswordCredentials::class) {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}
}
name = "EldoNexus"
url = uri(publishData.getRepository())
}
}
}
tasks {
compileJava {
options.encoding = "UTF-8"
}
compileTestJava {
options.encoding = "UTF-8"
}
test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
shadowJar {
relocate("org.bstats", shadebase + "bstats")
mergeServiceFiles()
minimize()
}
processResources {
from(sourceSets.main.get().resources.srcDirs) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
register<Copy>("copyToServer") {
val path = project.property("targetDir") ?: "";
if (path.toString().isEmpty()) {
println("targetDir is not set in gradle properties")
return@register
}
from(shadowJar)
destinationDir = File(path.toString())
}
build {
dependsOn(shadowJar)
}
runServer {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion("1.21.1")
}
}
bukkit {
authors = listOf("RainbowDashLabs")
main = "de.eldoria.pickmeup.PickMeUp"
website = "https://www.spigotmc.org/resources/88151/"
apiVersion = "1.13"
softDepend = listOf("BentoBox", "RedProtect", "GriefPrevention", "PlotSquared", "Towny", "Citizens")
commands {
register("pickmeup") {
description = "Main command of pick me up"
usage = "Trust the tab completion"
aliases = listOf("pmu")
}
}
}
hangarPublish {
publications.register("plugin") {
version.set(publishData.getVersion())
id = "PickMeUp"
channel = System.getenv("HANGAR_CHANNEL")
apiKey = System.getenv("HANGAR_KEY")
platforms {
register(Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf("1.16.5-1.21"))
}
}
}
}