Skip to content

Commit ab0874c

Browse files
committed
Apply microtus patches 1-20
1 parent 33dff6f commit ab0874c

File tree

295 files changed

+6126
-2414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+6126
-2414
lines changed

build-logic/build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
gradlePluginPortal()
8+
}
9+
10+
dependencies {
11+
val indraVersion = "3.1.3"
12+
implementation("org.jetbrains.kotlin", "kotlin-gradle-plugin", "1.9.20")
13+
implementation("net.kyori", "indra-common", indraVersion)
14+
implementation("net.kyori", "indra-common", indraVersion)
15+
implementation("net.kyori", "indra-publishing-sonatype", indraVersion)
16+
implementation("org.graalvm.buildtools", "native-gradle-plugin", "0.9.28")
17+
implementation("io.github.gradle-nexus", "publish-plugin", "2.0.0-rc-1")
18+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
plugins {
2+
java
3+
}
4+
5+
// Always exclude checker-qual. This is the single most annoying thing that always reappears.
6+
configurations.all {
7+
// We only use Jetbrains Annotations
8+
exclude("org.checkerframework", "checker-qual")
9+
}
10+
11+
java {
12+
toolchain {
13+
languageVersion.set(JavaLanguageVersion.of(21))
14+
}
15+
}
16+
17+
tasks {
18+
withType<JavaCompile> {
19+
// We are fully aware, that we should be suppressing these instead of ignoring them here, but man keep my terminal clean.
20+
options.compilerArgs.addAll(listOf("-Xlint:none", "-Xlint:-deprecation", "-Xlint:-unchecked"))
21+
}
22+
withType<Test> {
23+
useJUnitPlatform()
24+
// Viewable packets make tracking harder. Could be re-enabled later.
25+
jvmArgs("-Dminestom.viewable-packet=false")
26+
jvmArgs("-Dminestom.inside-test=true")
27+
}
28+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
plugins {
2+
id("minestom.common-conventions")
3+
id("org.graalvm.buildtools.native")
4+
}
5+
6+
graalvmNative {
7+
binaries {
8+
named("main") {
9+
buildArgs.add("--allow-incomplete-classpath")
10+
// One day toolchains will support getting this automagically, but that day is not today.
11+
toolchainDetection.set(false)
12+
}
13+
}
14+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
plugins {
2+
id("net.kyori.indra")
3+
id("net.kyori.indra.publishing")
4+
id("net.kyori.indra.publishing.sonatype")
5+
id("io.github.gradle-nexus.publish-plugin")
6+
}
7+
8+
indra {
9+
javaVersions {
10+
target(21)
11+
testWith(21)
12+
}
13+
14+
github("OneLiteFeatherNET", "Microtus") {
15+
ci(true)
16+
publishing(false)
17+
}
18+
mitLicense()
19+
signWithKeyFromPrefixedProperties("onelitefeather")
20+
configurePublications {
21+
pom {
22+
developers {
23+
developer {
24+
id.set("themeinerlp")
25+
name.set("Phillipp Glanz")
26+
email.set("p.glanz@madfix.me")
27+
}
28+
developer {
29+
id.set("theEvilReaper")
30+
name.set("Steffen Wonning")
31+
email.set("steffenwx@gmail.com")
32+
}
33+
}
34+
}
35+
}
36+
}
37+
38+
indraSonatype {
39+
useAlternateSonatypeOSSHost("s01")
40+
}

build.gradle.kts

Lines changed: 73 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,50 @@
1-
import java.time.Duration
1+
import java.util.*
22

33
plugins {
44
`java-library`
5+
id("minestom.publishing-conventions")
6+
id("minestom.native-conventions")
57
alias(libs.plugins.blossom)
6-
7-
`maven-publish`
88
signing
9-
alias(libs.plugins.nexuspublish)
109
}
1110

12-
// Read env vars (used for publishing generally)
13-
version = System.getenv("MINESTOM_VERSION") ?: "dev"
14-
val channel = System.getenv("MINESTOM_CHANNEL") ?: "local" // local, snapshot, release
15-
16-
val shortDescription = "1.20.4 Lightweight Minecraft server"
17-
18-
allprojects {
19-
apply(plugin = "java")
20-
21-
group = "net.minestom"
22-
version = rootProject.version
23-
description = shortDescription
11+
var baseVersion by extra("1.3.2")
12+
var snapshot by extra("-SNAPSHOT")
2413

25-
repositories {
26-
mavenCentral()
27-
maven(url = "https://jitpack.io")
28-
}
14+
group = "net.onelitefeather.microtus"
2915

30-
configurations.all {
31-
// We only use Jetbrains Annotations
32-
exclude("org.checkerframework", "checker-qual")
33-
}
3416

35-
java {
36-
withSourcesJar()
37-
withJavadocJar()
17+
version = "%s%s".format(Locale.ROOT, baseVersion, snapshot)
3818

39-
sourceCompatibility = JavaVersion.VERSION_21
40-
targetCompatibility = JavaVersion.VERSION_21
41-
}
42-
43-
tasks.withType<Zip> {
44-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
45-
}
46-
47-
tasks.withType<Test> {
48-
useJUnitPlatform()
49-
50-
// Viewable packets make tracking harder. Could be re-enabled later.
51-
jvmArgs("-Dminestom.viewable-packet=false")
52-
jvmArgs("-Dminestom.inside-test=true")
53-
minHeapSize = "512m"
54-
maxHeapSize = "1024m"
55-
}
56-
57-
tasks.withType<JavaCompile> {
58-
options.encoding = "UTF-8"
59-
}
19+
allprojects {
20+
group = "net.onelitefeather.microtus"
21+
version = "%s%s".format(Locale.ROOT, baseVersion, snapshot)
22+
description = "Lightweight and multi-threaded Minecraft server implementation"
6023
}
6124

6225
sourceSets {
6326
main {
64-
java.srcDir(file("src/main/java"))
65-
java.srcDir(file("src/autogenerated/java"))
27+
java {
28+
srcDir(file("src/autogenerated/java"))
29+
}
30+
blossom {
31+
javaSources {
32+
val gitCommit = System.getenv("GIT_COMMIT")
33+
val gitBranch = System.getenv("GIT_BRANCH")
34+
val group = System.getenv("GROUP")
35+
val artifact = System.getenv("ARTIFACT")
36+
property("\"&COMMIT\"", if (gitCommit == null) "null" else "\"${gitCommit}\"")
37+
property("\"&BRANCH\"", if (gitBranch == null) "null" else "\"${gitBranch}\"")
38+
property("\"&GROUP\"", if (group == null) "null" else "\"${group}\"")
39+
property("\"&ARTIFACT\"", if (artifact == null) "null" else "\"${artifact}\"")
40+
}
41+
}
6642
}
6743
}
6844

69-
dependencies {
70-
// Core dependencies
71-
api(libs.slf4j)
72-
api(libs.jetbrainsAnnotations)
73-
api(libs.bundles.adventure)
74-
api(libs.hydrazine)
75-
api(libs.bundles.kotlin)
76-
api(libs.bundles.hephaistos)
77-
implementation(libs.minestomData)
78-
implementation(libs.dependencyGetter)
79-
80-
// Performance/data structures
81-
implementation(libs.caffeine)
82-
api(libs.fastutil)
83-
implementation(libs.bundles.flare)
84-
api(libs.gson)
85-
implementation(libs.jcTools)
86-
87-
// Testing
88-
testImplementation(libs.bundles.junit)
89-
testImplementation(project(":testing"))
45+
java {
46+
withJavadocJar()
47+
withSourcesJar()
9048
}
9149

9250
tasks {
@@ -107,98 +65,63 @@ tasks {
10765
links("https://jd.adventure.kyori.net/api/${libs.versions.adventure.get()}/")
10866
}
10967
}
110-
111-
blossom {
112-
val gitFile = "src/main/java/net/minestom/server/Git.java"
113-
114-
val gitCommit = System.getenv("GIT_COMMIT")
115-
val gitBranch = System.getenv("GIT_BRANCH")
116-
val group = System.getenv("GROUP")
117-
val artifact = System.getenv("ARTIFACT")
118-
119-
replaceToken("\"&COMMIT\"", if (gitCommit == null) "null" else "\"${gitCommit}\"", gitFile)
120-
replaceToken("\"&BRANCH\"", if (gitBranch == null) "null" else "\"${gitBranch}\"", gitFile)
121-
replaceToken("\"&GROUP\"", if (group == null) "null" else "\"${group}\"", gitFile)
122-
replaceToken("\"&ARTIFACT\"", if (artifact == null) "null" else "\"${artifact}\"", gitFile)
68+
withType<Zip> {
69+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
12370
}
71+
withType<Test> {
72+
useJUnitPlatform()
12473

125-
nexusPublishing{
126-
useStaging.set(true)
127-
this.packageGroup.set("net.minestom")
128-
129-
transitionCheckOptions {
130-
maxRetries.set(360) // 1 hour
131-
delayBetween.set(Duration.ofSeconds(10))
132-
}
74+
// Viewable packets make tracking harder. Could be re-enabled later.
75+
jvmArgs("-Dminestom.viewable-packet=false")
76+
jvmArgs("-Dminestom.inside-test=true")
77+
minHeapSize = "512m"
78+
maxHeapSize = "1024m"
79+
}
13380

134-
repositories.sonatype {
135-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
136-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
13781

138-
if (System.getenv("SONATYPE_USERNAME") != null) {
139-
username.set(System.getenv("SONATYPE_USERNAME"))
140-
password.set(System.getenv("SONATYPE_PASSWORD"))
141-
}
142-
}
143-
}
82+
}
14483

145-
publishing.publications.create<MavenPublication>("maven") {
146-
groupId = "net.minestom"
147-
// todo: decide on publishing scheme
148-
artifactId = if (channel == "snapshot") "minestom-snapshots" else "minestom-snapshots"
149-
version = project.version.toString()
84+
dependencies {
85+
// Testing Framework
86+
testImplementation(project(mapOf("path" to ":testing")))
87+
// Only here to ensure J9 module support for extensions and our classloaders
88+
testCompileOnly(libs.mockito.core)
15089

151-
from(project.components["java"])
15290

153-
pom {
154-
name.set(this@create.artifactId)
155-
description.set(shortDescription)
156-
url.set("https://github.com/minestom/minestom")
91+
// Logging
92+
implementation(libs.bundles.logging)
93+
// Libraries required for the terminal
94+
implementation(libs.bundles.terminal)
15795

158-
licenses {
159-
license {
160-
name.set("Apache 2.0")
161-
url.set("https://github.com/minestom/minestom/blob/main/LICENSE")
162-
}
163-
}
96+
// Performance improving libraries
97+
implementation(libs.caffeine)
98+
api(libs.fastutil)
99+
implementation(libs.bundles.flare)
164100

165-
developers {
166-
developer {
167-
id.set("TheMode")
168-
}
169-
developer {
170-
id.set("mworzala")
171-
name.set("Matt Worzala")
172-
email.set("matt@hollowcube.dev")
173-
}
174-
}
101+
// Libraries
102+
api(libs.gson)
103+
implementation(libs.jcTools)
104+
// Path finding
105+
api(libs.hydrazine)
175106

176-
issueManagement {
177-
system.set("GitHub")
178-
url.set("https://github.com/minestom/minestom/issues")
179-
}
107+
// Adventure, for user-interface
108+
api(libs.bundles.adventure)
180109

181-
scm {
182-
connection.set("scm:git:git://github.com/minestom/minestom.git")
183-
developerConnection.set("scm:git:git@github.com:minestom/minestom.git")
184-
url.set("https://github.com/minestom/minestom")
185-
tag.set("HEAD")
186-
}
110+
// Kotlin Libraries
111+
api(libs.bundles.kotlin)
187112

188-
ciManagement {
189-
system.set("Github Actions")
190-
url.set("https://github.com/minestom/minestom/actions")
191-
}
192-
}
193-
}
113+
api(libs.maven.resolver)
114+
api(libs.maven.connector)
115+
api(libs.maven.transport.http)
194116

195-
signing {
196-
isRequired = System.getenv("CI") != null
117+
// Minestom Data (From MinestomDataGenerator)
118+
implementation(libs.minestomData)
197119

198-
val privateKey = System.getenv("GPG_PRIVATE_KEY")
199-
val keyPassphrase = System.getenv()["GPG_PASSPHRASE"]
200-
useInMemoryPgpKeys(privateKey, keyPassphrase)
120+
// NBT parsing/manipulation/saving
121+
api("io.github.jglrxavpok.hephaistos:common:${libs.versions.hephaistos.get()}")
122+
api("io.github.jglrxavpok.hephaistos:gson:${libs.versions.hephaistos.get()}")
201123

202-
sign(publishing.publications)
203-
}
124+
// BStats
125+
api(libs.bstats.base)
204126
}
127+

code-generators/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ plugins {
22
application
33
}
44

5+
repositories {
6+
mavenLocal()
7+
mavenCentral()
8+
}
9+
510
dependencies {
611
// Provides the input JSON to generate from
712
implementation(libs.minestomData)

0 commit comments

Comments
 (0)