This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
forked from Crazy-Crew/CrazyVouchers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
144 lines (112 loc) · 3.75 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
plugins {
`java-library`
`maven-publish`
id("com.modrinth.minotaur") version "2.6.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
repositories {
/**
* Placeholders
*/
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
/**
* NBT API
*/
maven("https://repo.codemc.org/repository/maven-public/")
/**
* Paper Team
*/
// maven("https://repo.papermc.io/repository/maven-public/")
// Spigot
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
// Item NBT api
maven("https://repo.codemc.org/repository/maven-public/")
/**
* Everything else we need.
*/
mavenCentral()
}
dependencies {
implementation("de.tr7zw", "item-nbt-api-plugin", "2.11.1")
implementation("org.bstats", "bstats-bukkit", "3.0.0")
// compileOnly("io.papermc.paper", "paper-api", "${project.extra["minecraft_version"]}-R0.1-SNAPSHOT")
compileOnly("org.spigotmc", "spigot-api", "1.19.3-R0.1-SNAPSHOT")
compileOnly("me.clip", "placeholderapi", "2.11.2") {
exclude(group = "org.spigotmc")
exclude(group = "org.bukkit")
}
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(project.extra["java_version"].toString()))
}
val isBeta: Boolean = extra["isBeta"].toString().toBoolean()
fun getPluginVersion(): String {
return if (isBeta) "${project.version}-BETA" else project.version.toString()
}
fun getPluginVersionType(): String {
return if (isBeta) "beta" else "release"
}
tasks {
shadowJar {
archiveFileName.set("${rootProject.name}-${getPluginVersion()}.jar")
listOf(
"de.tr7zw",
"org.bstats"
).forEach {
relocate(it, "${project.group}.plugin.lib.$it")
}
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(rootProject.name.toLowerCase())
versionName.set("${rootProject.name} ${getPluginVersion()}")
versionNumber.set(getPluginVersion())
versionType.set(getPluginVersionType())
uploadFile.set(shadowJar.get())
autoAddDependsOn.set(true)
gameVersions.addAll(listOf("1.18", "1.18.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3"))
loaders.addAll(listOf("paper", "purpur"))
//<h3>The first release for CrazyVouchers on Modrinth! 🎉🎉🎉🎉🎉<h3><br> If we want a header.
changelog.set("""
<h4>Changes:</h4>
<p>Added 1.18.2 support.</p>
<h4>Bug Fixes:</h4>
<p>N/A</p>
""".trimIndent())
}
compileJava {
options.release.set(project.extra["java_version"].toString().toInt())
}
processResources {
filesMatching("plugin.yml") {
expand(
"name" to rootProject.name,
"group" to project.group,
"version" to getPluginVersion(),
"description" to project.description,
"website" to "https://modrinth.com/plugin/${rootProject.name.toLowerCase()}"
)
}
}
}
publishing {
val mavenExt: String = if (isBeta) "beta" else "releases"
repositories {
maven("https://repo.crazycrew.us/$mavenExt") {
name = "crazycrew"
//credentials(PasswordCredentials::class)
credentials {
username = System.getenv("REPOSITORY_USERNAME")
password = System.getenv("REPOSITORY_PASSWORD")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = rootProject.name.toLowerCase()
version = getPluginVersion()
from(components["java"])
}
}
}