aboutsummaryrefslogtreecommitdiff
path: root/test-fabric
diff options
context:
space:
mode:
Diffstat (limited to 'test-fabric')
-rw-r--r--test-fabric/.gitignore42
-rw-r--r--test-fabric/build.gradle.kts57
-rw-r--r--test-fabric/src/main/java/dev/isxander/yacl/test/fabric/ModMenuEntrypoint.java12
-rw-r--r--test-fabric/src/main/resources/fabric.mod.json13
4 files changed, 124 insertions, 0 deletions
diff --git a/test-fabric/.gitignore b/test-fabric/.gitignore
new file mode 100644
index 0000000..b63da45
--- /dev/null
+++ b/test-fabric/.gitignore
@@ -0,0 +1,42 @@
+.gradle
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store \ No newline at end of file
diff --git a/test-fabric/build.gradle.kts b/test-fabric/build.gradle.kts
new file mode 100644
index 0000000..1d2d5fd
--- /dev/null
+++ b/test-fabric/build.gradle.kts
@@ -0,0 +1,57 @@
+plugins {
+ alias(libs.plugins.architectury.loom)
+ alias(libs.plugins.shadow)
+}
+
+architectury {
+ platformSetupLoomIde()
+ fabric()
+}
+
+loom {
+ silentMojangMappingsLicense()
+
+ accessWidenerPath.set(project(":common").loom.accessWidenerPath)
+}
+
+val common by configurations.registering
+val shadowCommon by configurations.registering
+configurations.compileClasspath.get().extendsFrom(common.get())
+configurations["developmentFabric"].extendsFrom(common.get())
+
+val minecraftVersion = libs.versions.minecraft.get()
+
+dependencies {
+ minecraft(libs.minecraft)
+ mappings(loom.layered {
+ mappings("org.quiltmc:quilt-mappings:$minecraftVersion+build.${libs.versions.quilt.mappings.get()}:intermediary-v2")
+ officialMojangMappings()
+ })
+ modImplementation(libs.fabric.loader)
+
+ "common"(project(path = ":test-common", configuration = "namedElements")) { isTransitive = false }
+ implementation(project(path = ":fabric", configuration = "namedElements"))
+
+ "common"(project(path = ":common", configuration = "namedElements")) { isTransitive = false }
+}
+
+tasks {
+ shadowJar {
+ exclude("architectury.common.json")
+
+ configurations = listOf(shadowCommon.get())
+ archiveClassifier.set("dev-shadow")
+ }
+
+ remapJar {
+ injectAccessWidener.set(true)
+ inputFile.set(shadowJar.get().archiveFile)
+ dependsOn(shadowJar)
+
+ archiveClassifier.set("fabric-$minecraftVersion")
+ }
+
+ jar {
+ archiveClassifier.set("dev")
+ }
+}
diff --git a/test-fabric/src/main/java/dev/isxander/yacl/test/fabric/ModMenuEntrypoint.java b/test-fabric/src/main/java/dev/isxander/yacl/test/fabric/ModMenuEntrypoint.java
new file mode 100644
index 0000000..b2dc876
--- /dev/null
+++ b/test-fabric/src/main/java/dev/isxander/yacl/test/fabric/ModMenuEntrypoint.java
@@ -0,0 +1,12 @@
+package dev.isxander.yacl.test.fabric;
+
+import com.terraformersmc.modmenu.api.ConfigScreenFactory;
+import com.terraformersmc.modmenu.api.ModMenuApi;
+import dev.isxander.yacl.test.GuiTest;
+
+public class ModMenuEntrypoint implements ModMenuApi {
+ @Override
+ public ConfigScreenFactory<?> getModConfigScreenFactory() {
+ return GuiTest::getModConfigScreenFactory;
+ }
+}
diff --git a/test-fabric/src/main/resources/fabric.mod.json b/test-fabric/src/main/resources/fabric.mod.json
new file mode 100644
index 0000000..15e28a4
--- /dev/null
+++ b/test-fabric/src/main/resources/fabric.mod.json
@@ -0,0 +1,13 @@
+{
+ "schemaVersion": 1,
+ "id": "yacl_test",
+ "version": "1",
+ "name": "YACL Test",
+ "license": "LGPL-3.0-or-later",
+ "environment": "*",
+ "entrypoints": {
+ "modmenu": [
+ "dev.isxander.yacl.test.fabric.ModMenuEntrypoint"
+ ]
+ }
+}