1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-21 07:49:32 +00:00

Preparations for using gametest framework

This commit is contained in:
onebeastchris
2025-10-22 17:07:36 +02:00
committed by Eclipse
parent e2a82b3659
commit 0977d0ce40
10 changed files with 103 additions and 25 deletions

View File

@@ -2,9 +2,9 @@ plugins {
id("geyser.modded-conventions") id("geyser.modded-conventions")
} }
architectury { //architectury {
common("neoforge", "fabric") // common("neoforge", "fabric")
} //}
loom { loom {
mixin.defaultRefmapName.set("geyser-refmap.json") mixin.defaultRefmapName.set("geyser-refmap.json")

View File

@@ -3,9 +3,28 @@ plugins {
id("geyser.modrinth-uploading-conventions") id("geyser.modrinth-uploading-conventions")
} }
architectury { //architectury {
platformSetupLoomIde() // platformSetupLoomIde()
fabric() // fabric()
//}
loom {
mods {
create("geyser-fabric") {
sourceSet(sourceSets.main.get())
sourceSet("main", projects.mod)
sourceSet("main", projects.core)
}
}
}
fabricApi {
configureTests {
createSourceSet = true
modId = "geyser-gametest"
enableClientGameTests = false
eula = true
}
} }
dependencies { dependencies {
@@ -13,7 +32,7 @@ dependencies {
modApi(libs.fabric.api) modApi(libs.fabric.api)
api(project(":mod", configuration = "namedElements")) api(project(":mod", configuration = "namedElements"))
shadowBundle(project(path = ":mod", configuration = "transformProductionFabric")) //shadowBundle(project(path = ":mod", configuration = "transformProductionFabric"))
shadowBundle(projects.core) shadowBundle(projects.core)
includeTransitive(projects.core) includeTransitive(projects.core)
@@ -37,14 +56,14 @@ dependencies {
include(libs.fabric.permissions.api) include(libs.fabric.permissions.api)
} }
tasks.withType<Jar> {
manifest.attributes["Main-Class"] = "org.geysermc.geyser.platform.fabric.GeyserFabricMain"
}
relocate("org.cloudburstmc.netty") relocate("org.cloudburstmc.netty")
relocate("org.cloudburstmc.protocol") relocate("org.cloudburstmc.protocol")
tasks { tasks {
jar {
manifest.attributes["Main-Class"] = "org.geysermc.geyser.platform.fabric.GeyserFabricMain"
}
remapJar { remapJar {
archiveBaseName.set("Geyser-Fabric") archiveBaseName.set("Geyser-Fabric")
} }
@@ -52,6 +71,19 @@ tasks {
remapModrinthJar { remapModrinthJar {
archiveBaseName.set("geyser-fabric") archiveBaseName.set("geyser-fabric")
} }
getByName("processGametestResources", ProcessResources::class) {
filesMatching("fabric.mod.json") {
expand(
"id" to "geyser",
"name" to "Geyser",
"version" to project.version,
"description" to project.description,
"url" to "https://geysermc.org",
"author" to "GeyserMC"
)
}
}
} }
modrinth { modrinth {

View File

@@ -1 +0,0 @@
loom.platform=fabric

View File

@@ -0,0 +1,30 @@
/*
* Copyright (c) 2025 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.geyser.gametest;
public class GeyserGameTest {
// TODO actually add gametests
}

View File

@@ -0,0 +1,13 @@
{
"schemaVersion": 1,
"id": "geyser-gametest",
"version": "1.0.0",
"name": "Geyser-GameTest",
"icon": "assets/geyser/icon.png",
"environment": "*",
"entrypoints": {
"fabric-gametest": [
"org.geysermc.geyser.gametest.GeyserGameTest"
]
}
}

View File

@@ -22,7 +22,8 @@ dependencies {
implementation(libs.lombok) implementation(libs.lombok)
implementation(libs.indra) implementation(libs.indra)
implementation(libs.shadow) implementation(libs.shadow)
implementation(libs.architectury.plugin) //implementation(libs.architectury.plugin)
implementation(libs.architectury.loom) //implementation(libs.architectury.loom)
implementation("fabric-loom:fabric-loom.gradle.plugin:1.12.0-alpha.45")
implementation(libs.minotaur) implementation(libs.minotaur)
} }

View File

@@ -5,8 +5,9 @@ import org.gradle.kotlin.dsl.dependencies
plugins { plugins {
id("geyser.platform-conventions") id("geyser.platform-conventions")
id("architectury-plugin") //id("architectury-plugin")
id("dev.architectury.loom") //id("dev.architectury.loom")
id("fabric-loom")
} }
// These are provided by Minecraft/modded platforms already, no need to include them // These are provided by Minecraft/modded platforms already, no need to include them
@@ -39,13 +40,13 @@ provided("org.ow2.asm", "asm")
provided("org.incendo", ".*") provided("org.incendo", ".*")
provided("io.leangen.geantyref", "geantyref") provided("io.leangen.geantyref", "geantyref")
architectury { //architectury {
minecraft = libs.minecraft.get().version as String // minecraft = libs.minecraft.get().version as String
} //}
loom { //loom {
silentMojangMappingsLicense() // silentMojangMappingsLicense()
} //}
indra { indra {
javaVersions { javaVersions {

View File

@@ -4,6 +4,8 @@ plugins {
alias(libs.plugins.blossom) alias(libs.plugins.blossom)
id("geyser.publish-conventions") id("geyser.publish-conventions")
id("io.freefair.lombok") id("io.freefair.lombok")
// Allows gametests/fabric runServer task to work correctly
id("net.fabricmc.fabric-loom-companion")
} }
dependencies { dependencies {

View File

@@ -34,7 +34,7 @@ bungeecord-api = "1.21-R0.1"
velocity = "3.4.0-SNAPSHOT" velocity = "3.4.0-SNAPSHOT"
viaproxy = "3.3.2-SNAPSHOT" viaproxy = "3.3.2-SNAPSHOT"
fabric-loader = "0.17.2" fabric-loader = "0.17.2"
fabric-api = "0.133.14+1.21.9" fabric-api = "0.136.0+1.21.10"
fabric-permissions-api = "0.4.1" fabric-permissions-api = "0.4.1"
neoforge-minecraft = "21.10.0-beta" neoforge-minecraft = "21.10.0-beta"
mixin = "0.8.5" mixin = "0.8.5"

View File

@@ -20,7 +20,7 @@ include(":ap")
include(":api") include(":api")
include(":bungeecord") include(":bungeecord")
include(":fabric") include(":fabric")
include(":neoforge") //include(":neoforge")
include(":mod") include(":mod")
include(":spigot") include(":spigot")
include(":standalone") include(":standalone")
@@ -32,7 +32,7 @@ include(":core")
// Specify project dirs // Specify project dirs
project(":bungeecord").projectDir = file("bootstrap/bungeecord") project(":bungeecord").projectDir = file("bootstrap/bungeecord")
project(":fabric").projectDir = file("bootstrap/mod/fabric") project(":fabric").projectDir = file("bootstrap/mod/fabric")
project(":neoforge").projectDir = file("bootstrap/mod/neoforge") //project(":neoforge").projectDir = file("bootstrap/mod/neoforge")
project(":mod").projectDir = file("bootstrap/mod") project(":mod").projectDir = file("bootstrap/mod")
project(":spigot").projectDir = file("bootstrap/spigot") project(":spigot").projectDir = file("bootstrap/spigot")
project(":standalone").projectDir = file("bootstrap/standalone") project(":standalone").projectDir = file("bootstrap/standalone")