forked from Crazy-Crew/CrazyCrates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
127 lines (94 loc) · 2.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
plugins {
alias(libs.plugins.shadow)
alias(libs.plugins.userdev)
alias(libs.plugins.modrinth)
}
val projectName = "${rootProject.name}-${project.name.substring(0, 1).uppercase() + project.name.substring(1)}"
base {
archivesName.set(projectName)
}
repositories {
flatDir { dirs("libs") }
}
dependencies {
api(project(":core"))
implementation("de.tr7zw", "item-nbt-api", "2.11.3")
implementation("org.bstats", "bstats-bukkit", "3.0.2")
implementation("dev.triumphteam", "triumph-cmd-bukkit", "2.0.0-SNAPSHOT")
compileOnly(fileTree("libs").include("*.jar"))
compileOnly("me.clip", "placeholderapi", "2.11.3")
compileOnly("com.github.decentsoftware-eu", "decentholograms","2.8.3")
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
}
val component: SoftwareComponent = components["java"]
tasks {
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = "${rootProject.name.lowercase()}-${project.name.lowercase()}-api"
version = project.version.toString()
from(component)
}
}
}
shadowJar {
archiveBaseName.set(projectName)
archiveClassifier.set("")
exclude("META-INF/**")
listOf(
"dev.triumphteam",
"org.jetbrains",
"org.bstats",
"de.tr7zw"
).forEach {
relocate(it, "libs.$it")
}
}
reobfJar {
outputJar.set(file("$buildDir/libs/$projectName-${project.version}.jar"))
}
assemble {
dependsOn(reobfJar)
}
processResources {
val props = mapOf(
"name" to rootProject.name,
"group" to project.group,
"version" to project.version,
"description" to rootProject.description,
"authors" to rootProject.properties["authors"],
"apiVersion" to "1.20",
"website" to "https://modrinth.com/plugin/${rootProject.name.lowercase()}"
)
filesMatching("plugin.yml") {
expand(props)
}
}
}
val file = file("${rootProject.rootDir}/jars/$projectName-${project.version}.jar")
val description = """
## New Features:
* N/A
## Fix:
* N/A
## Other:
* [Feature Requests](https://github.com/Crazy-Crew/${rootProject.name}/discussions/categories/features)
* [Bug Reports](https://github.com/Crazy-Crew/${rootProject.name}/issues)
""".trimIndent()
val versions = listOf(
"1.20",
"1.20.1",
"1.20.2"
)
modrinth {
autoAddDependsOn.set(false)
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(rootProject.name.lowercase())
versionName.set("${rootProject.name} ${project.version}")
versionNumber.set("${project.version}")
uploadFile.set(file)
gameVersions.addAll(versions)
changelog.set(description)
loaders.addAll("paper", "purpur")
}