-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
146 lines (127 loc) · 3.95 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
145
146
import groovy.json.JsonSlurper
import io.papermc.hangarpublishplugin.model.Platforms
plugins {
java
id("xyz.jpenilla.run-paper") version "2.2.3"
alias(libs.plugins.spotless)
alias(libs.plugins.hangar)
alias(libs.plugins.modrinth)
alias(libs.plugins.pluginyml)
alias(libs.plugins.publishdata)
`maven-publish`
}
group = "de.sirywell.noisypatterns"
version = "1.0.2"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
implementation(platform("com.intellectualsites.bom:bom-newest:1.42")) // Ref: https://github.com/IntellectualSites/bom
compileOnly(libs.bundles.fawe)
compileOnly(libs.paper)
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withSourcesJar()
withJavadocJar()
}
spotless {
java {
licenseHeaderFile(rootProject.file("HEADER.txt"))
target("**/*.java")
}
}
publishData {
addBuildData()
useEldoNexusRepos()
publishComponent("java")
}
publishing {
publications.create<MavenPublication>("maven") {
publishData.configurePublication(this)
}
repositories {
maven {
authentication {
credentials(PasswordCredentials::class) {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}
}
setUrl(publishData.getRepository())
name = "EldoNexus"
}
}
}
tasks {
// copied from PlotSquared
register("cacheLatestFaweArtifact") {
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>)
.map { it as Map<*, *> }
.map { it["fileName"] as String }
.firstOrNull { it.contains("Bukkit") }
project.ext["faweArtifact"] = artifact
}
runServer {
dependsOn(getByName("cacheLatestFaweArtifact"))
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
downloadPlugins {
url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/${project.ext["faweArtifact"]}")
}
minecraftVersion("1.20.4")
}
test {
useJUnitPlatform()
}
}
hangarPublish {
publications.register("plugin") {
version.set(publishData.getVersion())
id = "NoisyPatterns"
channel = System.getenv("HANGAR_CHANNEL")
apiKey = System.getenv("HANGAR_KEY")
platforms {
register(Platforms.PAPER) {
jar.set(tasks.jar.flatMap { it.archiveFile })
platformVersions.set(listOf("1.16.5-1.20.4"))
this.dependencies {
hangar("FastAsyncWorldEdit") {
required = true
}
}
}
}
}
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("QeTYqlgP")
versionNumber.set(publishData.getVersion())
versionType.set(System.getenv("MODRINTH_CHANNEL"))
uploadFile.set(tasks.jar)
gameVersions.addAll(listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.4"))
loaders.addAll(listOf("paper", "spigot"))
dependencies {
required.project("FastAsyncWorldEdit")
}
syncBodyFrom = rootProject.file("README.md").reader().readText()
}
bukkit {
name = "NoisyPatterns"
author = "SirYwell"
version = publishData.getVersion(true)
main = "de.sirywell.noisypatterns.NoisyPatternsPlugin"
depend = listOf("FastAsyncWorldEdit")
apiVersion = "1.16"
commands {
register("noisypatterns") {
description = "Noisy pattern info command"
}
}
}