From 0490fb57f5ea5e0e3cc28cbb9e0dd35315efb4cc Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Mon, 1 Jan 2024 11:16:51 +0100 Subject: [PATCH] Add dependencies tool page --- scripts/modrinth-api.js | 7 +++- scripts/smart-buildscript.js | 2 +- tools/dependencies.md | 74 ++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 tools/dependencies.md diff --git a/scripts/modrinth-api.js b/scripts/modrinth-api.js index 6586b0e5..b42d7538 100644 --- a/scripts/modrinth-api.js +++ b/scripts/modrinth-api.js @@ -77,7 +77,12 @@ export async function getVersions(modrinthProjectId) { versions.set(gameVersion, []); } - versions.get(gameVersion).push({ version: modrinthVersion.version_number, name: modrinthVersion.name, modrinthId: modrinthVersion.id }); + versions.get(gameVersion).push({ + version: modrinthVersion.version_number, + name: modrinthVersion.name, + modrinthId: modrinthVersion.id, + loaders: modrinthVersion.loaders, + }); }); }); diff --git a/scripts/smart-buildscript.js b/scripts/smart-buildscript.js index cd17d51d..10c1fc9e 100644 --- a/scripts/smart-buildscript.js +++ b/scripts/smart-buildscript.js @@ -60,7 +60,7 @@ function selectVersion(version, mods, pin) { // replace the version in the buildscript for (const modName of mods) { - doReplace(modName, version.modVersions.get(modName)?.[0]?.name ?? `<${modName.toLocaleUpperCase()}_VERSION>`); + doReplace(modName, version.modVersions.get(modName)?.filter((v) => v.loaders.includes('fabric') || v.loaders.includes('quilt'))?.[0]?.name ?? `<${modName.toLocaleUpperCase()}_VERSION>`); } } diff --git a/tools/dependencies.md b/tools/dependencies.md new file mode 100644 index 00000000..83445e31 --- /dev/null +++ b/tools/dependencies.md @@ -0,0 +1,74 @@ +--- +layout: default +title: Common Dependencies +--- + +This page is here to help us quickly find dependency versions we often use in our mods. +The version strings may be invalid maven identifiers, as they are currently pulled from Modrinth. +{:.admonition .admonition-warning} + +{% capture groovy %} +`gradle.properties`: +```properties +# Blabber +blabber_version = +# Cardinal Components +cca_version = +# EMI +emi = "" +# Mod Menu +modmenu = "" +# Roughly Enough Items +rei = "" +``` +{% endcapture %} +{% capture kts %} +`gradle.properties`: +```properties +# Blabber +blabber_version = +# Cardinal Components +cca_version = +# EMI +emi = "" +# Mod Menu +modmenu = "" +# Roughly Enough Items +rei = "" +``` +{% endcapture %} +{% capture catalogue %} +`libs.versions.toml`: +```toml +[versions] +# Blabber +blabber = "" +# Cardinal Components API +cca = "" +# EMI +emi = "" +# Mod Menu +modmenu = "" +# Roughly Enough Items +rei = "" + +[libraries] +blabber = { module = "org.ladysnake:blabber", version.ref = "blabber" } +cca-base = { module = "dev.onyxstudios.cardinal-components-api:cardinal-components-base", version.ref = "cardinalComponentsApi" } +cca-entity = { module = "dev.onyxstudios.cardinal-components-api:cardinal-components-entity", version.ref = "cardinalComponentsApi" } +emi = { module = "dev.emi:emi-fabric", version.ref = "emi" } +modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu"} +rei-api = { module = "me.shedaniel:RoughlyEnoughItems-api-fabric", version.ref = "rei" } +``` +{% endcapture %} +{%- assign blabber = "blabber:2oRMVFgd" | split: ":" %} +{%- assign mods = "" | split: "," | push: blabber %} +{%- assign cca = "cca:K01OU20C" | split: ":" %} +{%- assign mods = mods | push: cca %} +{%- assign emi = "emi:fRiHVvU7" | split: ":" %} +{%- assign mods = mods | push: emi %} +{%- assign modmenu = "modmenu:mOgUt4GM" | split: ":" %} +{%- assign mods = mods | push: modmenu %} +{%- assign rei = "rei:nfn13YXA" | split: ":" %} +{%- assign mods = mods | push: rei %} +{%- include tabbed_builscript.liquid mods=mods groovy=groovy kts=kts catalogue=catalogue %}