Skip to content

Commit

Permalink
Add dependencies tool page
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jan 1, 2024
1 parent a874c40 commit 0490fb5
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
7 changes: 6 additions & 1 deletion scripts/modrinth-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
});

Expand Down
2 changes: 1 addition & 1 deletion scripts/smart-buildscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>`);
}
}

Expand Down
74 changes: 74 additions & 0 deletions tools/dependencies.md
Original file line number Diff line number Diff line change
@@ -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 = <BLABBER_VERSION>
# Cardinal Components
cca_version = <CCA_VERSION>
# EMI
emi = "<EMI_VERSION>"
# Mod Menu
modmenu = "<MODMENU_VERSION>"
# Roughly Enough Items
rei = "<REI_VERSION>"
```
{% endcapture %}
{% capture kts %}
`gradle.properties`:
```properties
# Blabber
blabber_version = <BLABBER_VERSION>
# Cardinal Components
cca_version = <CCA_VERSION>
# EMI
emi = "<EMI_VERSION>"
# Mod Menu
modmenu = "<MODMENU_VERSION>"
# Roughly Enough Items
rei = "<REI_VERSION>"
```
{% endcapture %}
{% capture catalogue %}
`libs.versions.toml`:
```toml
[versions]
# Blabber
blabber = "<BLABBER_VERSION>"
# Cardinal Components API
cca = "<CCA_VERSION>"
# EMI
emi = "<EMI_VERSION>"
# Mod Menu
modmenu = "<MODMENU_VERSION>"
# Roughly Enough Items
rei = "<REI_VERSION>"

[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 %}

0 comments on commit 0490fb5

Please sign in to comment.