feat: add quilt support

It is not working at all
This commit is contained in:
xtex 2023-08-01 16:56:38 +08:00
parent 9aa248e7f2
commit dca1482526
Signed by: xtex
GPG Key ID: B918086ED8045B91
12 changed files with 186 additions and 28 deletions

View File

@ -1,17 +0,0 @@
architectury {
common("fabric", "quilt")
}
loom {
accessWidenerPath.set(project(":common").loom.accessWidenerPath)
}
dependencies {
modImplementation("net.fabricmc:fabric-loader:${rootProject.property("fabric_loader_version")}")
modApi("net.fabricmc.fabric-api:fabric-api:${rootProject.property("fabric_version")}")
modApi("dev.architectury:architectury-fabric:${rootProject.property("architectury_version")}")
compileOnly(project(":common", "namedElements")) {
isTransitive = false
}
}

View File

@ -33,12 +33,6 @@ dependencies {
shadowCommon(project(":common", "transformProductionFabric")){ shadowCommon(project(":common", "transformProductionFabric")){
isTransitive = false isTransitive = false
} }
common(project(":fabric-like", "namedElements")) {
isTransitive = false
}
shadowCommon(project(":fabric-like", "transformProductionFabric")){
isTransitive = false
}
} }
tasks.processResources { tasks.processResources {

View File

@ -1,9 +1,9 @@
package quaedam.fabriclike package quaedam.fabric
import net.fabricmc.api.ModInitializer import net.fabricmc.api.ModInitializer
import quaedam.Quaedam import quaedam.Quaedam
object QuaedamFabricLike: ModInitializer { object QuaedamFabric: ModInitializer {
override fun onInitialize() { override fun onInitialize() {
Quaedam.init() Quaedam.init()

View File

@ -18,7 +18,7 @@
"main": [ "main": [
{ {
"adapter": "kotlin", "adapter": "kotlin",
"value": "quaedam.fabriclike.QuaedamFabricLike" "value": "quaedam.fabric.QuaedamFabric"
} }
] ]
}, },

View File

@ -3,15 +3,25 @@ org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048M org.gradle.jvmargs=-Xmx2048M
minecraft_version=1.20.1 minecraft_version=1.20.1
parchment_version=2023.07.16 parchment_version=2023.07.30
# https://modrinth.com/mod/architectury-api # https://modrinth.com/mod/architectury-api
architectury_version=9.1.12 architectury_version=9.1.12
# https://files.minecraftforge.net/net/minecraftforge/forge/ # https://files.minecraftforge.net/net/minecraftforge/forge/
forge_version=1.20.1-47.1.43 forge_version=1.20.1-47.1.43
# https://modrinth.com/mod/kotlin-for-forge # https://modrinth.com/mod/kotlin-for-forge
kotlin_for_forge_version=4.4.0 kotlin_for_forge_version=4.4.0
# https://fabricmc.net/develop/ # https://fabricmc.net/develop/
fabric_loader_version=0.14.21 fabric_loader_version=0.14.21
fabric_version=0.86.1+1.20.1 fabric_version=0.86.1+1.20.1
# https://modrinth.com/mod/fabric-language-kotlin # https://modrinth.com/mod/fabric-language-kotlin
fabric_kotlin_version=1.10.8+kotlin.1.9.0 fabric_kotlin_version=1.10.8+kotlin.1.9.0
# https://github.com/QuiltMC/quilt-loader/tags
quilt_loader_version=0.20.0-beta.5
# https://modrinth.com/mod/qsl
quilt_fabric_version=7.0.3+0.83.1-1.20.1
quilt_standard_library_version=6.0.4+1.20.1
# https://modrinth.com/mod/qkl
quilt_kotlin_libraries_version=2.1.1+kt.1.9.0+flk.1.9.6

86
quilt/build.gradle.kts Normal file
View File

@ -0,0 +1,86 @@
plugins {
id("com.github.johnrengelman.shadow")
}
architectury {
platformSetupLoomIde()
loader("quilt")
}
loom {
accessWidenerPath.set(project(":common").loom.accessWidenerPath)
}
val common: Configuration by configurations.creating
val shadowCommon: Configuration by configurations.creating
val developmentQuilt: Configuration by configurations.getting
configurations {
compileOnly.configure { extendsFrom(common) }
runtimeOnly.configure { extendsFrom(common) }
developmentQuilt.extendsFrom(common)
}
dependencies {
modImplementation("org.quiltmc:quilt-loader:${rootProject.property("quilt_loader_version")}")
modApi("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${rootProject.property("quilt_fabric_version")}")
modApi("dev.architectury:architectury-fabric:${rootProject.property("architectury_version")}") {
exclude("net.fabricmc")
exclude("net.fabricmc.fabric-api")
}
modApi("org.quiltmc:qsl:${rootProject.property("quilt_standard_library_version")}")
modApi("org.quiltmc.quilt-kotlin-libraries:quilt-kotlin-libraries:${rootProject.property("quilt_kotlin_libraries_version")}")
common(project(":common", "namedElements")) {
isTransitive = false
}
shadowCommon(project(":common", "transformProductionQuilt")) {
isTransitive = false
}
}
tasks.processResources {
inputs.property("version", project.version)
filesMatching("quilt.mod.json") {
expand(
mapOf(
"version" to project.version,
"minecraft_version" to rootProject.property("minecraft_version"),
"architectury_version" to rootProject.property("architectury_version"),
"quilt_kotlin_libraries_version" to rootProject.property("quilt_kotlin_libraries_version"),
)
)
}
}
tasks.shadowJar {
exclude("architectury.common.json")
configurations = listOf(shadowCommon)
archiveClassifier.set("dev-shadow")
}
tasks.remapJar {
injectAccessWidener.set(true)
inputFile.set(tasks.shadowJar.get().archiveFile)
dependsOn(tasks.shadowJar)
archiveClassifier.set(null as String?)
}
tasks.jar {
archiveClassifier.set("dev")
}
tasks.sourcesJar {
val commonSources = project(":common").tasks.getByName<Jar>("sourcesJar")
dependsOn(commonSources)
from(commonSources.archiveFile.map { zipTree(it) })
}
components.getByName("java") {
this as AdhocComponentWithVariants
this.withVariantsFromConfiguration(project.configurations["shadowRuntimeElements"]) {
skip()
}
}

1
quilt/gradle.properties Normal file
View File

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

View File

@ -0,0 +1,12 @@
package quaedam.quilt
import net.fabricmc.api.ModInitializer
import quaedam.Quaedam
object QuaedamQuilt: ModInitializer {
override fun onInitialize() {
Quaedam.init()
}
}

View File

@ -0,0 +1,13 @@
{
"required": true,
"package": "quaedam.fabric.mixin",
"compatibilityLevel": "JAVA_17",
"minVersion": "0.8",
"client": [
],
"mixins": [
],
"injectors": {
"defaultRequire": 1
}
}

View File

@ -0,0 +1,59 @@
{
"_comment": "https://github.com/QuiltMC/rfcs/blob/main/specification/0002-quilt.mod.json.md",
"schema_version": 1,
"mixin": [
"quaedam-common.mixins.json"
],
"quilt_loader": {
"metadata": {
"name": "Quaedam",
"description": "Hot hot hot!",
"license": "Apache-2.0",
"authors": [
"xtex"
],
"contact": {
"homepage": "https://codeberg.org/xtex/quaedam",
"sources": "https://codeberg.org/xtex/quaedam"
},
"icon": "assets/quaedam/icon.png"
},
"group": "quaedam",
"id": "quaedam",
"version": "${version}",
"intermediate_mappings": "net.fabricmc:intermediary",
"entrypoints": {
"init": [
{
"adapter": "kotlin",
"value": "quaedam.quilt.QuaedamQuilt"
}
]
},
"depends": [
{
"id": "quilt_loader",
"version": "*"
},
{
"id": "quilt_base",
"version": "*"
},
{
"id": "minecraft",
"version": ">=${minecraft_version}"
},
{
"id": "architectury",
"version": ">=${architectury_version}"
},
{
"id": "qkl",
"version": ">=${quilt_kotlin_libraries_version}"
}
]
},
"minecraft": {
"environment": "*"
}
}

View File

@ -10,6 +10,6 @@ pluginManagement {
include("common") include("common")
include("forge") include("forge")
include("fabric-like", "fabric") include("fabric", "quilt")
rootProject.name = "quaedam" rootProject.name = "quaedam"