add froglib dependency to template

This commit is contained in:
moehreag 2024-06-10 23:52:02 +02:00
parent 006bf0222c
commit 2b0bd27b1b
3 changed files with 18 additions and 9 deletions

View file

@ -1,6 +1,3 @@
import dev.frogmc.phytotelma.ext.minecraft
import dev.frogmc.phytotelma.ext.loader
plugins { plugins {
id("java") id("java")
id("dev.frogmc.phytotelma").version("$phytotelma_version") id("dev.frogmc.phytotelma").version("$phytotelma_version")
@ -19,6 +16,7 @@ dependencies {
phytotelma { phytotelma {
loader(project.libs.versions.frogloader) loader(project.libs.versions.frogloader)
froglib(project.libs.versions.froglib)
minecraft(project.libs.versions.minecraft) minecraft(project.libs.versions.minecraft)
} }

View file

@ -2,8 +2,10 @@
minecraft = "$game_version" minecraft = "$game_version"
loader = "$loader_version" loader = "$loader_version"
froglib = "$froglib_version"
[libraries] [libraries]
# technically unused
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
loader = { module = "dev.frogmc:frogloader", version.ref = "loader" } loader = { module = "dev.frogmc:frogloader", version.ref = "loader" }
froglib = { module = "dev.frogmc:froglib", version.ref = "froglib" }

View file

@ -26,8 +26,10 @@ outline: false
let versions = [] let versions = []
let latestLoader let latestLoader
let latestPhytotelma let latestPhytotelma
let latestFrogLib
let latestLoaderSnapshot let latestLoaderSnapshot
let latestPhytotelmaSnapshot let latestPhytotelmaSnapshot
let latestFrogLibSnapshot
async function getGameVersions() { async function getGameVersions() {
const response = await fetch("https://piston-meta.mojang.com/mc/game/version_manifest_v2.json") const response = await fetch("https://piston-meta.mojang.com/mc/game/version_manifest_v2.json")
@ -82,12 +84,12 @@ outline: false
}).catch((err) => { }).catch((err) => {
document.getElementById("phytotelmaVersionReleaseBadge").innerHTML = "No version found!" document.getElementById("phytotelmaVersionReleaseBadge").innerHTML = "No version found!"
}), }),
/*fetchVersionFromMaven("releases", "froglib").then((v) => { fetchVersionFromMaven("releases", "froglib").then((v) => {
latestPhytotelma = v latestFrogLib = v
document.getElementById("froglibVersionReleaseBadge").innerHTML = v document.getElementById("froglibVersionReleaseBadge").innerHTML = v
}).catch((err) => { }).catch((err) => {
document.getElementById("froglibVersionReleaseBadge").innerHTML = "No version found!" document.getElementById("froglibVersionReleaseBadge").innerHTML = "No version found!"
}),*/ }),
fetchVersionFromMaven("snapshots", "frogloader").then((v) => { fetchVersionFromMaven("snapshots", "frogloader").then((v) => {
latestLoaderSnapshot = v latestLoaderSnapshot = v
document.getElementById("frogLoaderVersionSnapshotBadge").innerHTML = v document.getElementById("frogLoaderVersionSnapshotBadge").innerHTML = v
@ -95,7 +97,13 @@ outline: false
fetchVersionFromMaven("snapshots", "phytotelma").then((v) => { fetchVersionFromMaven("snapshots", "phytotelma").then((v) => {
latestPhytotelmaSnapshot = v latestPhytotelmaSnapshot = v
document.getElementById("phytotelmaVersionSnapshotBadge").innerHTML = v document.getElementById("phytotelmaVersionSnapshotBadge").innerHTML = v
}) }),
fetchVersionFromMaven("snapshots", "froglib").then((v) => {
latestFrogLibSnapshot = v
document.getElementById("froglibVersionSnapshotBadge").innerHTML = v
}).catch((err) => {
document.getElementById("froglibVersionSnapshotBadge").innerHTML = "No version found!"
}),
]) ])
} }
@ -230,6 +238,7 @@ outline: false
data = data.replaceAll("$license", licenseRef.value) data = data.replaceAll("$license", licenseRef.value)
data = data.replaceAll("$loader_version", useSnapshots.value ? latestLoaderSnapshot : latestLoader) data = data.replaceAll("$loader_version", useSnapshots.value ? latestLoaderSnapshot : latestLoader)
data = data.replaceAll("$phytotelma_version", useSnapshots.value ? latestPhytotelmaSnapshot : latestPhytotelma) data = data.replaceAll("$phytotelma_version", useSnapshots.value ? latestPhytotelmaSnapshot : latestPhytotelma)
data = data.replaceAll("$froglib_version", useSnapshots.value ? latestFrogLibSnapshot : latestFrogLib)
data = data.replaceAll("$game_version", versionSelector.value.value) data = data.replaceAll("$game_version", versionSelector.value.value)
return data return data
}) })