forked from Chicken/BlueMap-Towny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
131 lines (116 loc) · 3.92 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
plugins {
java
id ("com.github.johnrengelman.shadow") version "8.1.1"
id ("com.modrinth.minotaur") version "2.+"
id ("io.papermc.hangar-publish-plugin") version "0.0.5"
}
group = "codes.antti"
version = "2.1.2"
repositories {
mavenCentral()
maven {
setUrl ("https://repo.papermc.io/repository/maven-public/")
}
maven {
setUrl ("https://oss.sonatype.org/content/groups/public/")
}
maven {
setUrl ("https://repo.glaremasters.me/repository/towny/")
}
maven {
setUrl ("https://jitpack.io/")
}
maven {
setUrl ("https://repo.mikeprimm.com/")
}
}
dependencies {
compileOnly ("dev.folia:folia-api:1.20.4-R0.1-SNAPSHOT")
compileOnly ("com.palmergames.bukkit.towny:towny:0.100.0.0")
compileOnly ("com.github.BlueMap-Minecraft:BlueMapAPI:v2.4.0")
compileOnly ("us.dynmap:DynmapCoreAPI:3.4")
implementation ("com.github.TechnicJelle:UpdateCheckerJava:v2.1") {
exclude ( group = "org.jetbrains", module = "annotations" )
exclude ( group = "org.intellij.lang", module = "annotations" )
}
implementation ("com.github.TechnicJelle:BMUtils:v4.2") {
exclude ( group = "org.jetbrains", module = "annotations" )
exclude ( group = "org.intellij.lang", module = "annotations" )
}
}
val javaTarget = 17
java {
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)
}
tasks.processResources {
from("src/main/resources") {
include("plugin.yml")
duplicatesStrategy = DuplicatesStrategy.INCLUDE
expand (
"version" to project.version
)
}
}
tasks.withType(JavaCompile::class).configureEach {
options.apply {
encoding = "utf-8"
}
}
tasks.withType(AbstractArchiveTask::class).configureEach {
isReproducibleFileOrder = true
isPreserveFileTimestamps = false
}
tasks.build {
dependsOn(tasks.shadowJar)
}
tasks.jar {
archiveClassifier.set("nonshadow")
}
tasks.shadowJar {
archiveClassifier.set("")
relocate ("com.technicjelle", "codes.antti.bluemaptowny.shadow.jelle")
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("Y6O9cRjl")
versionNumber.set(project.version as String)
changelog.set("View the changelog at [GitHub releases](https://github.com/Chicken/BlueMap-Towny/releases/tag/${project.version})")
uploadFile.set(tasks.findByName("shadowJar"))
loaders.addAll("spigot", "paper", "folia")
gameVersions.addAll(
"1.16.5",
"1.17", "1.17.1",
"1.18", "1.18.1", "1.18.2",
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
"1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4",
"1.20.5", "1.20.6"
)
}
hangarPublish {
publications.register("plugin") {
version.set(project.version as String)
namespace("Chicken", "BlueMap-Towny")
channel.set("Release")
changelog.set("View the changelog at [GitHub releases](https://github.com/Chicken/BlueMap-Towny/releases/tag/${project.version})")
apiKey.set(System.getenv("HANGAR_TOKEN"))
platforms {
register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) {
url.set("https://github.com/Chicken/BlueMap-Towny/releases/download/${project.version}/BlueMap-Towny-${project.version}.jar")
dependencies.hangar("Blue", "BlueMap")
dependencies.hangar("TownyAdvanced", "Towny")
platformVersions.set(listOf(
"1.16.5",
"1.17", "1.17.1",
"1.18", "1.18.1", "1.18.2",
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
"1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4"
))
}
}
}
}
tasks.register("publish") {
dependsOn("modrinth")
dependsOn("publishPluginPublicationToHangar")
}