forked from datatags/ConstantHunger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
99 lines (87 loc) · 3.12 KB
/
build.gradle.kts
File metadata and controls
99 lines (87 loc) · 3.12 KB
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
plugins {
id("java")
// https://github.com/GradleUp/shadow
alias(libs.plugins.shadow)
// https://github.com/JetBrains/gradle-idea-ext-plugin
alias(libs.plugins.gradleideaext)
id("maven-publish")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
repositories {
mavenLocal()
mavenCentral()
// Sonatype
maven(url = "https://oss.sonatype.org/content/groups/public")
// JitPack
maven(url = "https://jitpack.io")
// SpigotMC
maven(url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots")
// FoliaLib
maven(url = "https://repo.tcoded.com/releases")
}
dependencies {
// https://mvnrepository.com/artifact/org.jetbrains/annotations
compileOnly(libs.annotations)
// https://github.com/google/gson
implementation(libs.gson)
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation(libs.commonslang3)
// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot
compileOnly(libs.spigot)
// https://github.com/TechnicallyCoded/FoliaLib
implementation(libs.folia)
// https://github.com/dejvokep/boosted-yaml
implementation(libs.boostedyaml)
// https://github.com/KyoriPowered/adventure
implementation(libs.adventureapi)
// https://github.com/Revxrsal/Lamp
implementation(libs.lampcommon)
implementation(libs.lampbukkit)
// https://github.com/Bastian/bstats-metrics
implementation(libs.bstats)
}
tasks {
compileJava {
options.encoding = "UTF-8"
}
shadowJar {
exclude("META-INF/**", "LICENSE")
relocate("org.jetbrains.annotations", "me.datatags.constanthunger.libs.annotations")
relocate("com.google.gson", "me.datatags.constanthunger.libs.gson")
relocate("org.apache.commons", "me.datatags.constanthunger.libs.commonslang3")
relocate("com.tcoded.folialib", "me.datatags.constanthunger.libs.folialib")
relocate("dev.dejvokep.boostedyaml", "me.datatags.constanthunger.libs.boostedyaml")
relocate("org.bstats", "me.datatags.constanthunger.libs.metrics")
archiveFileName.set("${project.name}-${project.version}.jar")
}
build {
dependsOn(shadowJar)
}
processResources {
filesMatching("plugin.yml") {
expand(
"name" to project.property("name").toString(),
"groupid" to project.property("groupid").toString(),
"artifactid" to project.property("artifactid").toString(),
"description" to project.property("description").toString(),
"version" to project.property("version").toString(),
"apiversion" to project.property("apiversion").toString(),
"author" to project.property("author").toString()
)
}
}
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.property("groupid").toString()
artifactId = project.property("artifactid").toString()
version = project.property("version").toString()
artifact(tasks.shadowJar)
}
}
}