Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Floodgate-Fabric merge #466

Draft
wants to merge 30 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
63d1d38
Initial build script start on Fabric
Konicai Sep 6, 2022
db41cec
Try quilt-loom
Konicai Sep 6, 2022
5ecb120
Add minecraft/quilt dependencies
Konicai Sep 6, 2022
def9079
Fix jackson issue and repositories issue
Konicai Sep 6, 2022
cc48dac
setup more dependencies
Konicai Sep 6, 2022
5b9bd51
Add remapped shadow jar, update gradle
Konicai Sep 21, 2022
c758e9e
Doc and formatting
Konicai Sep 21, 2022
dd5e194
Fix shadow configurations
Konicai Sep 21, 2022
7840bf8
Update github actions
Konicai Sep 21, 2022
ff7b397
Use loom 1.0-SNAPSHOT
Konicai Sep 21, 2022
2b43ca9
Add loom to root project (no apply)
Konicai Sep 22, 2022
375e31e
Merge remote-tracking branch 'upstream/development' into pr/353
onebeastchris Jun 20, 2023
5e18b85
start on updating the floodgate-fabric merge pr to the latest floodga…
onebeastchris Jun 20, 2023
ec798c7
more changes
onebeastchris Jun 20, 2023
0b432fb
isolated might work now.. how logger work?
onebeastchris Jun 20, 2023
b99e050
loom works now, yay
onebeastchris Jun 20, 2023
f840c11
loom libs reference works now
onebeastchris Jun 21, 2023
15910ce
we kinda need mixins, oops
onebeastchris Jun 21, 2023
b93fcb3
Merge remote-tracking branch 'upstream/development' into pr/353
onebeastchris Jul 14, 2023
515bdf6
yeet FabricMod.java
onebeastchris Jul 14, 2023
4480f1d
loom wants its ~ own ~ repos
onebeastchris Jul 14, 2023
71f88dd
Merge remote-tracking branch 'upstream/development' into feature/fabric
onebeastchris Nov 10, 2023
0773637
Move to Gradle 8.4
onebeastchris Nov 11, 2023
fdbb5dc
finally got architectury set up
onebeastchris Nov 11, 2023
edaab84
Add initial mixins
onebeastchris Nov 17, 2023
5f7ebd0
fix aw, start working on fixing building... meh this is weird
onebeastchris Nov 17, 2023
5688102
Version bump
onebeastchris Nov 18, 2023
a0e46a3
apply base coventions plugin also to modded
onebeastchris Nov 19, 2023
a5b14dc
let's try strict versions?
onebeastchris Nov 19, 2023
89b19ab
let's temporarily uncomment h2 who literally insert a singular java 2…
onebeastchris Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
java-version: '17'
cache: 'gradle'

- name: Build with Maven
- name: Build with Gradle
run: ./gradlew build

- name: Archive artifacts (Floodgate Bungee)
Expand All @@ -27,6 +27,13 @@ jobs:
name: Floodgate Bungee
path: bungee/build/libs/floodgate-bungee.jar

- name: Archive artifacts (Floodgate Fabric)
uses: actions/upload-artifact@v2
if: success()
with:
name: Floodgate Fabric
path: fabric/build/libs/floodgate-fabric.jar

- name: Archive artifacts (Floodgate Spigot)
uses: actions/upload-artifact@v2
if: success()
Expand Down
9 changes: 8 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ allprojects {
}

//todo differentiate maven publishing from downloads publishing
//todo add fabric projects to be deployed
val deployProjects = setOf(
projects.api,
// for future Floodgate integration + Fabric
Expand All @@ -36,14 +37,19 @@ val deployProjects = setOf(

val shadowProjects = setOf(
projects.api,
// for future Floodgate integration + Fabric
projects.core,
projects.bungeeBase,
projects.spigotBase,
projects.velocityBase,
projects.universal
).map { it.dependencyProject }

val moddedProjects = setOf(
projects.mod.commonBase,
projects.fabric,
projects.mod.fabricBase
).map { it.dependencyProject }

//todo re-add checkstyle when we switch back to 2 space indention
// and take a look again at spotbugs someday

Expand All @@ -56,6 +62,7 @@ subprojects {

when (this) {
in deployProjects -> plugins.apply("floodgate.publish-conventions")
in moddedProjects -> plugins.apply("floodgate.modded-conventions")
else -> plugins.apply("floodgate.base-conventions")
}

Expand Down
10 changes: 10 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@ plugins {

repositories {
gradlePluginPortal()

maven("https://repo.opencollab.dev/maven-snapshots/")
maven("https://maven.fabricmc.net/")
maven("https://maven.minecraftforge.net/")
maven("https://maven.architectury.dev/")
}

dependencies {
implementation(libs.indra.common)
implementation(libs.indra.git)
implementation(libs.shadow)
implementation(libs.gradle.idea.ext)
implementation(libs.architectury.plugin)
implementation(libs.architectury.loom)

// TODO: Add modrinth
//implementation("com.modrinth.minotaur:Minotaur:2.7.5")
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ indra {

javaVersions {
target(17)
strictVersions(true)
}
}

tasks {
processResources {
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json")) {
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json", "fabric.mod.json")) {
expand(
"id" to "floodgate",
"name" to "floodgate",
Expand Down
30 changes: 30 additions & 0 deletions buildSrc/src/main/kotlin/floodgate.modded-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("floodgate.base-conventions")
id("architectury-plugin") apply true
id("dev.architectury.loom") apply true
}

architectury {
minecraft = "1.20.2"
}

loom {
silentMojangMappingsLicense()
mixin.defaultRefmapName.set("floodgate-mod-refmap.json")
}

dependencies {
minecraft("com.mojang:minecraft:1.20.2")
mappings(loom.officialMojangMappings())
}

repositories {
maven("https://repo.opencollab.dev/maven-releases/")
maven("https://repo.opencollab.dev/maven-snapshots/")
maven("https://jitpack.io")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://maven.fabricmc.net/")
maven("https://maven.minecraftforge.net/")
maven("https://maven.architectury.dev/")
}
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
annotationProcessor(libs.micronaut.data.processor)
compileOnlyApi(libs.jakarta.persistence)

runtimeOnly("com.h2database:h2")
//runtimeOnly("com.h2database:h2")

testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform.launcher)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@
import java.util.concurrent.TimeUnit;
import org.geysermc.floodgate.api.logger.FloodgateLogger;
import org.geysermc.floodgate.core.command.util.Permission;
import org.geysermc.floodgate.core.news.data.AnnouncementData;
import org.geysermc.floodgate.core.news.data.BuildSpecificData;
import org.geysermc.floodgate.core.news.data.CheckAfterData;
import org.geysermc.floodgate.core.platform.command.CommandUtil;
import org.geysermc.floodgate.core.util.Constants;
import org.geysermc.floodgate.core.util.HttpClient;
import org.geysermc.floodgate.core.util.HttpClient.HttpResponse;
import org.geysermc.floodgate.news.NewsItem;
import org.geysermc.floodgate.news.NewsItemAction;
import org.geysermc.floodgate.news.data.AnnouncementData;
import org.geysermc.floodgate.news.data.BuildSpecificData;
import org.geysermc.floodgate.news.data.CheckAfterData;

@Singleton
public class NewsChecker {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
* @link https://github.com/GeyserMC/Floodgate
*/

package org.geysermc.floodgate.news;
package org.geysermc.floodgate.core.news;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.geysermc.floodgate.news.data.ItemData;

import org.geysermc.floodgate.core.news.data.ItemData;

public final class NewsItem {
private final int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @link https://github.com/GeyserMC/Geyser
*/

package org.geysermc.floodgate.news;
package org.geysermc.floodgate.core.news;

public enum NewsItemAction {
ON_SERVER_STARTED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @link https://github.com/GeyserMC/Geyser
*/

package org.geysermc.floodgate.news;
package org.geysermc.floodgate.core.news;

import com.google.gson.JsonArray;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@
* @link https://github.com/GeyserMC/Floodgate
*/

package org.geysermc.floodgate.news;
package org.geysermc.floodgate.core.news;

import com.google.gson.JsonObject;
import java.util.function.Function;
import org.geysermc.floodgate.news.data.AnnouncementData;
import org.geysermc.floodgate.news.data.BuildSpecificData;
import org.geysermc.floodgate.news.data.CheckAfterData;
import org.geysermc.floodgate.news.data.ConfigSpecificData;
import org.geysermc.floodgate.news.data.ItemData;

import org.geysermc.floodgate.core.news.data.*;

public enum NewsType {
BUILD_SPECIFIC(BuildSpecificData::read),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @link https://github.com/GeyserMC/Floodgate
*/

package org.geysermc.floodgate.news.data;
package org.geysermc.floodgate.core.news.data;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @link https://github.com/GeyserMC/Geyser
*/

package org.geysermc.floodgate.news.data;
package org.geysermc.floodgate.core.news.data;

import com.google.gson.JsonObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @link https://github.com/GeyserMC/Geyser
*/

package org.geysermc.floodgate.news.data;
package org.geysermc.floodgate.core.news.data;

import com.google.gson.JsonObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @link https://github.com/GeyserMC/Floodgate
*/

package org.geysermc.floodgate.news.data;
package org.geysermc.floodgate.core.news.data;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @link https://github.com/GeyserMC/Geyser
*/

package org.geysermc.floodgate.news.data;
package org.geysermc.floodgate.core.news.data;

public interface ItemData {
}
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ org.gradle.parallel=true
systemProp.org.gradle.unsafe.kotlin.assignment=true

version=2.2.2-SNAPSHOT
micronautVersion=4.1.3
micronautVersion=4.1.3

# Increase ram for Gradle JVM
org.gradle.jvmargs=-Xmx4G
38 changes: 36 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ base-api = "feature-floodgate-merge-1.1.0-SNAPSHOT"
config-utils = "development-2.0-SNAPSHOT"
fastutil = "8.5.3"
java-websocket = "1.5.2"
cloud = "1.5.0"
cloud = "1.8.3"
snakeyaml = "2.0"
bstats = "3.0.2"
jakarta-persistence = "3.1.0"

# bungee
bungee = "master-SNAPSHOT"
Expand All @@ -28,6 +29,22 @@ authlib = "5.0.47"
# velocity
velocity = "3.2.0-SNAPSHOT"

# fabric
fabric_minecraft = "1.20.2"
fabric_loader = "0.14.20"
fabric_api = "0.90.7+1.20.2"
fabric_adventure = "5.4.0-SNAPSHOT"
fabric_permissions_api = "0.2-SNAPSHOT"

# forge

# mod common
mixin = "0.8.5"

# architectury
architectury_plugin = "3.4-SNAPSHOT"
architectury_loom = "1.4-SNAPSHOT"

# buildSrc
indra = "3.1.3"
shadow = "8.1.1"
Expand Down Expand Up @@ -64,7 +81,7 @@ micronaut-validation-processor = { module = "io.micronaut.validation:micronaut-v
micronaut-data-processor = { module = "io.micronaut.data:micronaut-data-processor" }
micronaut-data-jdbc = { module = "io.micronaut.data:micronaut-data-jdbc" }
micronaut-hikari = { module = "io.micronaut.sql:micronaut-jdbc-hikari" }
jakarta-persistence = { module = "jakarta.persistence:jakarta.persistence-api" }
jakarta-persistence = { module = "jakarta.persistence:jakarta.persistence-api", version.ref = "jakarta-persistence" }

micronaut-serde-jsonp = { module = "io.micronaut.serde:micronaut-serde-jsonp" }
micronaut-serde-processor = { module = "io.micronaut.serde:micronaut-serde-processor" }
Expand All @@ -91,13 +108,30 @@ authlib = { module = "com.mojang:authlib", version.ref = "authlib" }
cloud-velocity = { module = "cloud.commandframework:cloud-velocity", version.ref = "cloud" }
velocity-api = { module = "com.velocitypowered:velocity-api", version.ref = "velocity" }

# fabric
# check these on https://modmuss50.me/fabric.html
fabric-minecraft = { group = "com.mojang", name = "minecraft", version.ref = "fabric_minecraft" }
fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric_loader" }
fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric_api" }
cloud-fabric = { module = "cloud.commandframework:cloud-fabric", version.ref = "cloud" }
kyori-adventure = { module = "net.kyori:adventure-platform-fabric", version.ref = "fabric_adventure" }
fabric-permissions-api = { module = "me.lucko:fabric-permissions-api", version.ref = "fabric_permissions_api" }

# forge TODO

# mod common
mixin = { group = "org.spongepowered", name = "mixin", version.ref = "mixin" }

# buildSrc
checker-qual = { module = "org.checkerframework:checker-qual", version.ref = "checkerframework" }

# plugins
indra-common = { module = "net.kyori:indra-common", version.ref = "indra" }
indra-git = { module = "net.kyori:indra-git", version.ref = "indra" }
shadow = { module = "com.github.johnrengelman:shadow", version.ref = "shadow" }
gradle-idea-ext = { module = "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext", version.ref = "gradle-idea-ext" }
architectury-loom = { group = "dev.architectury.loom", name = "dev.architectury.loom.gradle.plugin", version.ref = "architectury_loom" }
architectury-plugin = { group = "architectury-plugin", name = "architectury-plugin.gradle.plugin", version.ref = "architectury_plugin" }

[plugins]
micronaut = { id = "io.micronaut.library", version.ref = "micronaut-gradle" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.geysermc.floodgate.isolation.util.UrlUtil;

public class PlatformLoader {

//TODO: Mixins need to be loaded *before* we try to enable/download Floodgate...
public static LibraryManager createLibraryManager(ClassLoader loader, Path cacheDirectory) {
return new LibraryManager(loader, cacheDirectory, true)
.addLibrary(
Expand Down
18 changes: 18 additions & 0 deletions mod/common/base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
architectury {
common("fabric")
}

loom {
accessWidenerPath.set(file("src/main/resources/floodgate.accesswidener"))
}

dependencies {
api(projects.core)

compileOnly(libs.mixin)
annotationProcessor(projects.core)
annotationProcessor(libs.micronaut.inject.java)
compileOnlyApi(projects.isolation)
}

provided(libs.gson)
Loading
Loading