-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
80 lines (66 loc) · 1.76 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
plugins {
java
`maven-publish`
alias(libs.plugins.paperweight.userdev)
alias(libs.plugins.run)
alias(libs.plugins.resource.paper)
}
val developmentVersion = "1.2.1"
version = getVersion()
group = "live.minehub"
repositories {
mavenCentral()
}
dependencies {
paperweight.paperDevBundle("${libs.versions.minecraft.get()}-R0.1-SNAPSHOT")
compileOnly(libs.zstd)
compileOnly(libs.adventure.nbt)
}
tasks {
assemble {
dependsOn(reobfJar)
}
runServer {
minecraftVersion(libs.versions.minecraft.get())
}
}
publishing {
repositories {
// Publish to Maven Local only if not running in an action environment
if (!isAction()) {
mavenLocal()
} else {
maven {
name = if (version.toString().endsWith("-SNAPSHOT")) "Snapshots" else "Releases"
url = uri("https://repo.minehub.live/" + if (version.toString().endsWith("-SNAPSHOT")) "snapshots" else "releases")
credentials {
username = System.getenv("REPO_ACTOR")
password = System.getenv("REPO_TOKEN")
}
}
}
}
publications {
create<MavenPublication>("shadow") {
from(components["java"])
}
}
}
fun isAction(): Boolean {
return System.getenv("CI") != null
}
fun getVersion(): String {
return if (!isAction()) {
developmentVersion
} else {
project.findProperty("version") as String
}
}
paperPluginYaml {
name = project.name
version = project.version.toString()
description = "Polar world format for Paper"
apiVersion = "1.21"
main = "live.minehub.polarpaper.PolarPaper"
loader = "live.minehub.polarpaper.PolarPaperLoader"
}