Cleanup modloader metadata files and replace more properties in them

This commit is contained in:
Jared 2023-06-11 02:31:29 +02:00
parent 9efe38d385
commit 6de6f20cbd
5 changed files with 44 additions and 92 deletions

View File

@ -53,6 +53,12 @@ subprojects {
it.options.release = 17 it.options.release = 17
} }
processResources {
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'mods.toml']) {
expand project.properties
}
}
// Disables Gradle's custom module metadata from being published to maven. The // Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by // metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers. // other mod developers.

View File

@ -15,16 +15,6 @@ dependencies {
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
} }
processResources {
def buildProps = project.properties.clone()
filesMatching(['pack.mcmeta']) {
expand buildProps
}
}
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {

View File

@ -32,14 +32,8 @@ loom {
} }
} }
processResources { processResources {
from project(":common").sourceSets.main.resources from project(":common").sourceSets.main.resources
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {

View File

@ -1,39 +1,35 @@
{ {
"schemaVersion": 1, "schemaVersion": 1,
"id": "modid", "id": "mod_id",
"version": "${version}", "version": "${version}",
"name": "${mod_name}",
"name": "Example Mod",
"description": "This is an example description! Tell everyone what your mod is about!", "description": "This is an example description! Tell everyone what your mod is about!",
"authors": [ "authors": [
"Me!" "${mod_author}"
], ],
"contact": { "contact": {
"homepage": "https://fabricmc.net/", "homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod" "sources": "https://github.com/FabricMC/fabric-example-mod"
}, },
"license": "CC0-1.0", "license": "CC0-1.0",
"icon": "assets/modid/icon.png", "icon": "assets/modid/icon.png",
"environment": "*", "environment": "*",
"entrypoints": { "entrypoints": {
"main": [ "main": [
"com.example.examplemod.ExampleMod" "com.example.examplemod.ExampleMod"
] ]
}, },
"mixins": [ "mixins": [
"modid.mixins.json" "modid.mixins.json"
], ],
"depends": { "depends": {
"fabricloader": ">=0.14", "fabricloader": ">=0.14",
"fabric": "*", "fabric": "*",
"minecraft": "1.19.3", "minecraft": "1.19.3",
"java": ">=17" "java": ">=17"
}, },
"suggests": { "suggests": {
"another-mod": "*" "another-mod": "*"
} }
} }

View File

@ -1,62 +1,28 @@
# This is an example mods.toml file. It contains the data relating to the loading mods. modLoader = "javafml" #mandatory
# There are several mandatory fields (#mandatory), and many more that are optional (#optional). loaderVersion = "[44,)" #mandatory This is typically bumped every Minecraft version by Forge. See https://files.minecraftforge.net/ for a list of versions.
# The overall format is standard TOML format, v0.5.0. license = "All rights reserved" # Review your options at https://choosealicense.com/.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here: https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[44,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="All rights reserved"
# A URL to refer people to when problems occur with this mod
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional #issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory [[mods]] #mandatory
# The modid of the mod modId = "multiloader" #mandatory
modId="multiloader" #mandatory version = "${file.jarVersion}" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it displayName = "Example Mod" #mandatory
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata #updateJSONURL="https://change.me.example.invalid/updates.json" #optional (see https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/)
# see the associated build.gradle script for how to populate this completely automatically during a build #displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional (displayed in the mod UI)
version="${file.jarVersion}" #mandatory logoFile = "multiloader.png" #optional (needs to be in the root of your mod jar (root of your 'resources' folder))
# A display name for the mod credits = "Thanks for this example mod goes to Java" #optional
displayName="Example Mod" #mandatory authors = "${mod_author}" #optional
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/ description = '''
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="multiloader.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Love, Cheese and small house plants" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
This is a long form description of the mod. You can write whatever you want here This is a long form description of the mod. You can write whatever you want here
''' #mandatory (Supports multiline text)
Have some lorem ipsum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.multiloader]] #optional [[dependencies.multiloader]] #optional
# the modid of the dependency modId = "forge" #mandatory
modId="forge" #mandatory mandatory = true #mandatory
# Does this dependency have to exist - if not, ordering below must be specified versionRange = "[44,)" #mandatory
mandatory=true #mandatory ordering = "NONE" # The order that this dependency should load in relation to your mod, required to be either 'BEFORE' or 'AFTER' if the dependency is not mandatory
# The version range of the dependency side = "BOTH" # Side this dependency is applied on - 'BOTH', 'CLIENT' or 'SERVER'
versionRange="[44,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
# Here's another dependency
[[dependencies.multiloader]] [[dependencies.multiloader]]
modId="minecraft" modId = "minecraft"
mandatory=true mandatory = true
# This version range declares a minimum of the current minecraft version up to but not including the next major version versionRange = "[1.19.3,1.20)"
versionRange="[1.19.3,1.20)" ordering = "NONE"
ordering="NONE" side = "BOTH"
side="BOTH"