-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
123 lines (97 loc) · 3.08 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
import me.modmuss50.mpp.ModPublishExtension
import me.modmuss50.mpp.PublishModTask
plugins {
id("java-library")
id("maven-publish")
alias(libs.plugins.pluginyml.bukkit)
alias(libs.plugins.runtask.paper)
alias(libs.plugins.shadow)
alias(libs.plugins.publishing)
}
group = "dev.booky"
val plugin: Configuration by configurations.creating {
isTransitive = false
}
repositories {
maven("https://repo.cloudcraftmc.de/public/")
}
dependencies {
compileOnly(libs.paper.api)
implementation(libs.bstats.bukkit)
compileOnlyApi(libs.cloudcore)
compileOnly(libs.commandapi.bukkit.core)
// testserver dependency plugins
plugin(variantOf(libs.cloudcore) { classifier("all") })
plugin(libs.commandapi.bukkit.plugin)
}
java {
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.ADOPTIUM
}
}
publishing {
publications.create<MavenPublication>("maven") {
artifactId = project.name.lowercase()
from(components["java"])
}
}
bukkit {
main = "$group.vanish.CloudVanishMain"
apiVersion = "1.20"
authors = listOf("booky10")
depend = listOf("CloudCore", "CommandAPI")
}
tasks {
runServer {
minecraftVersion("1.21.1")
pluginJars.from(plugin.resolve())
}
withType<Jar> {
// no spigot mappings are used, disable useless remapping step
manifest.attributes("paperweight-mappings-namespace" to "mojang")
}
shadowJar {
relocate("org.bstats", "dev.booky.vanish.bstats")
}
assemble {
dependsOn(shadowJar)
}
}
configure<ModPublishExtension> {
val repositoryName = "CloudCraftProjects/CloudVanish"
changelog = "See https://github.com/$repositoryName/releases/tag/v${project.version}"
type = if (project.version.toString().endsWith("-SNAPSHOT")) BETA else STABLE
dryRun = !hasProperty("noDryPublish")
file = tasks.named<Jar>("shadowJar").flatMap { it.archiveFile }
additionalFiles.from(tasks.named<Jar>("sourcesJar"))
github {
accessToken = providers.environmentVariable("GITHUB_API_TOKEN")
.orElse(providers.gradleProperty("ccGithubToken"))
displayName = "${rootProject.name} v${project.version}"
repository = repositoryName
commitish = "master"
tagName = "v${project.version}"
if (project != rootProject) {
parent(rootProject.tasks.named("publishGithub"))
}
}
modrinth {
accessToken = providers.environmentVariable("MODRINTH_API_TOKEN")
.orElse(providers.gradleProperty("ccModrinthToken"))
version = "${project.version}"
displayName = "${rootProject.name} v${project.version}"
modLoaders.add("paper")
projectId = "CtTP3zU8"
minecraftVersionRange {
start = rootProject.libs.versions.paper.get().split("-")[0]
end = "latest"
}
requires("commandapi", "cloudcore")
}
}
tasks.withType<PublishModTask> {
dependsOn(tasks.named<Jar>("shadowJar"))
dependsOn(tasks.named<Jar>("sourcesJar"))
}