Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit 97b9c0b

Browse files
committed
Convert buildscripts to Kotlin, use convention plugins
Signed-off-by: Lilly Rose Berner <[email protected]>
1 parent ffed4d2 commit 97b9c0b

File tree

80 files changed

+457
-1415
lines changed

Some content is hidden

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

80 files changed

+457
-1415
lines changed

.gitignore

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
1-
# Gradle
21
.gradle/
3-
build/
4-
out/
5-
classes/
6-
7-
# Quilt Loom
8-
remappedSrc/
9-
run/
10-
11-
# Eclipse
12-
*.launch
13-
14-
# IntelliJ Idea
152
.idea/
16-
*.iml
17-
*.ipr
18-
*.iws
19-
20-
# Visual Studio Code
21-
.settings/
223
.vscode/
23-
bin/
24-
.classpath
25-
.project
26-
27-
# Eclipse JDT LS
28-
workspace/
29-
30-
# macOS
31-
*.DS_Store
4+
build/
5+
run/

build-logic/build.gradle.kts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
maven {
7+
name = "Fabric"
8+
url = uri("https://maven.fabricmc.net/")
9+
}
10+
maven {
11+
name = "Ornithe Releases"
12+
url = uri("https://maven.ornithemc.net/releases")
13+
}
14+
maven {
15+
name = "Quilt"
16+
url = uri("https://maven.quiltmc.org/repository/release")
17+
}
18+
gradlePluginPortal()
19+
}
20+
21+
dependencies {
22+
implementation(libs.quilt.loom)
23+
implementation(libs.ploceus)
24+
25+
// Enable using version catalog in local plugins
26+
// https://github.com/gradle/gradle/issues/15383
27+
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
28+
}
29+
30+
kotlin {
31+
jvmToolchain(21)
32+
}

build-logic/settings.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
}
5+
}
6+
7+
dependencyResolutionManagement {
8+
versionCatalogs {
9+
create("libs") {
10+
from(files("../gradle/libs.versions.toml"))
11+
}
12+
}
13+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
plugins {
2+
id("base")
3+
}
4+
5+
fun mavenGroup(): String {
6+
val path = project.path.split(":");
7+
val base = project.property("maven_group").toString();
8+
9+
/*
10+
if (path.size < 2) {
11+
return base;
12+
} else {
13+
return base + "." + path[1].replace("-", "_");
14+
}
15+
*/
16+
17+
return base + project.path.replace(":", ".");
18+
}
19+
20+
// Each project needs a unique identifier,
21+
// Otherwise projects with the same name don't work.
22+
group = mavenGroup()
23+
version = project.property("mod_version").toString()
24+
25+
tasks.withType<ProcessResources> {
26+
inputs.property("version", project.property("mod_version"))
27+
28+
filesMatching("quilt.mod.json") {
29+
expand(inputs.properties)
30+
}
31+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
plugins {
2+
id("java")
3+
}
4+
5+
java {
6+
withSourcesJar()
7+
8+
toolchain {
9+
languageVersion = JavaLanguageVersion.of(8)
10+
}
11+
}
12+
13+
tasks.withType<JavaCompile> {
14+
options.encoding = "UTF-8"
15+
16+
javaCompiler = javaToolchains.compilerFor {
17+
languageVersion = JavaLanguageVersion.of(8)
18+
}
19+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import org.gradle.accessors.dm.LibrariesForLibs
2+
3+
plugins {
4+
id("server_stats.base")
5+
id("server_stats.java")
6+
}
7+
8+
val libs = the<LibrariesForLibs>()
9+
10+
repositories {
11+
mavenCentral()
12+
maven {
13+
name = "Fabric"
14+
url = uri("https://maven.fabricmc.net/")
15+
}
16+
maven {
17+
name = "Ornithe"
18+
url = uri("https://maven.ornithemc.net/releases")
19+
}
20+
maven {
21+
name = "Quilt"
22+
url = uri("https://maven.quiltmc.org/repository/release")
23+
}
24+
}
25+
26+
dependencies {
27+
compileOnly(libs.gson)
28+
compileOnly(libs.annotations)
29+
implementation(libs.quilt.loader)
30+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import org.gradle.accessors.dm.LibrariesForLibs
2+
3+
plugins {
4+
id("org.quiltmc.loom")
5+
id("ploceus")
6+
id("server_stats.base")
7+
id("server_stats.java")
8+
}
9+
10+
val libs = the<LibrariesForLibs>()
11+
val isMerged = !project.hasProperty("environment")
12+
val minecraftVersion = project.property("minecraft_version");
13+
14+
loom {
15+
mixin {
16+
useLegacyMixinAp.set(false)
17+
}
18+
}
19+
20+
if (!isMerged) {
21+
val isClient = project.property("environment") == "client"
22+
23+
ploceus {
24+
if (isClient) {
25+
clientOnlyMappings()
26+
} else {
27+
serverOnlyMappings()
28+
}
29+
}
30+
31+
loom {
32+
if (isClient) {
33+
clientOnlyMinecraftJar()
34+
} else {
35+
serverOnlyMinecraftJar()
36+
}
37+
}
38+
}
39+
40+
dependencies {
41+
modImplementation(libs.quilt.loader)
42+
minecraft("com.mojang:minecraft:${minecraftVersion}")
43+
44+
compileOnly(libs.gson)
45+
compileOnly(libs.annotations)
46+
47+
if (project.hasProperty("nests_build")) {
48+
nests(ploceus.nests(project.property("nests_build").toString()))
49+
}
50+
mappings(ploceus.featherMappings(project.property("feather_build").toString()))
51+
}

build.gradle

Lines changed: 0 additions & 90 deletions
This file was deleted.

build.gradle.kts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
plugins {
2+
id("server_stats.module")
3+
}
4+
5+
dependencies {
6+
// include(libs.gson)
7+
8+
// b1.5.0 -> first version with statistics!
9+
include(project(":versions:1.0.0-beta.1.5.0-to-1.0.0-beta.1.7.3-client"))
10+
include(project(":versions:1.0.0-beta.1.5.0-to-1.0.0-beta.1.5.2-server"))
11+
// b1.6.0 -> changed PlayerManager.respawn signature
12+
include(project(":versions:1.0.0-beta.1.6.0-to-1.0.0-beta.1.7.3-server"))
13+
14+
// b1.8.0 -> added DamageSource, Minecraft.startGame signature changed
15+
include(project(":versions:1.0.0-beta.1.8.0-to-1.0.0-beta.1.8.1-client"))
16+
include(project(":versions:1.0.0-beta.1.8.0-to-1.0.0-beta.1.8.1-server"))
17+
18+
// 1.0.0 -> Initial release
19+
// NOTE: client works until 1.0.0-pre.3 in theory
20+
include(project(":versions:1.0.0-to-1.1.0-alpha.11w48a-client"))
21+
include(project(":versions:1.0.1-to-1.1.0-alpha.11w48a-server"))
22+
// 11w49a -> CustomPayloadPacket added
23+
include(project(":versions:1.1.0-alpha.11w49a-to-1.1.0-alpha.11w50a-client"))
24+
include(project(":versions:1.1.0-alpha.11w49a-to-1.1.0-alpha.11w50a-server"))
25+
// 12w01a -> Entities.register and MinecraftServer.loadWorld signature changed
26+
include(project(":versions:1.1.0-alpha.12w01a-to-1.2.0-alpha.12w06a-client"))
27+
include(project(":versions:1.1.0-alpha.12w01a-to-1.2.0-alpha.12w06a-server"))
28+
// 12w07a -> added redstone lamp
29+
include(project(":versions:1.2.0-alpha.12w07a-to-1.3.0-alpha.12w16a-client"))
30+
include(project(":versions:1.2.0-alpha.12w07a-to-1.3.0-alpha.12w16a-server"))
31+
// 12w17a -> ...
32+
include(project(":versions:1.3.0-alpha.12w17a-to-1.3.0-alpha.12w17a-client"))
33+
include(project(":versions:1.3.0-alpha.12w17a-to-1.3.0-alpha.12w17a-server"))
34+
// NOTE: 12w18a to 12w21a are v weird ..
35+
// NOTE: All further snapshots including 1.3.0-pre.1 unsupported, for now
36+
// 1.3.2 -> now merged!
37+
include(project(":versions:1.3.2-to-1.4.0-alpha.12w38b"))
38+
// 12w39a -> ...
39+
include(project(":versions:1.4.0-alpha.12w39a-to-1.4.7"))
40+
// 13w01a -> added comparator
41+
include(project(":versions:1.5.0-alpha.13w01a-to-1.5.0-alpha.13w01b"))
42+
//13w02a -> ...
43+
include(project(":versions:1.5.0-alpha.13w02a-to-1.5.2"))
44+
// 13w16a -> ...
45+
include(project(":versions:1.6.0-alpha.13w16a-to-1.6.4"))
46+
// 13w36a -> server-side statistics
47+
include(project(":versions:1.7.0-alpha.13w36a-to-1.8.0-alpha.14w05b"))
48+
// 14w06a -> new statistics format, no upgrade path :(
49+
include(project(":versions:1.8.0-alpha.14w06a-to-1.12.2"))
50+
}
51+
52+
tasks.remapJar {
53+
from("LICENSE")
54+
}

gradle.properties

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@
22
org.gradle.jvmargs = -Xmx1G
33
org.gradle.parallel = true
44

5-
# Loom Properties
6-
fabric.loom.multiProjectOptimisation=true
7-
85
# Mod Properties
96
mod_version = 1.3.1
107
maven_group = net.lostluma
118
archives_base_name = server-stats
129

13-
minecraft_version_min = 1.0.0-beta.1.5.0
14-
minecraft_version_max = 1.12.2
15-
1610
# Minecraft Properties
17-
minecraft_version = 1.0.1
18-
19-
nests_version = 1.0.1-server+build.1
20-
feather_version = 1.0.1-server+build.11
11+
minecraft_version = 1.8
12+
feather_build = 11

0 commit comments

Comments
 (0)