PrismLauncher / meta

Prism Launcher Metadata generation scripts
Microsoft Public License
16 stars 17 forks source link

Add java runtime metadata #19

Closed Ryex closed 2 months ago

Ryex commented 1 year ago

Adds Java runtime metadata to metadata server

data is located at net.minecraft.java/java{major_version}.json

looks like

// net.minecraft.java/java8.json
{
    "formatVersion": 1,
    "name": "Java 8",
    "releaseTime": "2023-04-20T17:44:02+00:00",
    "runtimes": {
        "{os}-{arch}" [
            {
                "checksum": {
                    "hash": "c529f68a6febc042e71835a579f44d55a3717c46",
                    "type": "sha1"
                },
                "downloadType": "manifest",
                "name": "mojang_jre_8u202",
                "recommended": true,
                "releaseTime": "2020-11-17T19:26:25+00:00",
                "url": "https://piston-meta.mojang.com/v1/packages/c529f68a6febc042e71835a579f44d55a3717c46/manifest.json",
                "vendor": "mojang",
                "version": {
                    "major": 8,
                    "minor": 0,
                    "name": "8u202",
                    "security": 202
                }
            },
            {
                "checksum": {
                    "hash": "b6fdfe32085a884c11b31f66aa67ac62811df7112fb6fb08beea61376a86fbb4",
                    "type": "sha256"
                },
                "downloadType": "archive",
                "name": "eclipse_temurin_jre8.0.372+7",
                "recommended": false,
                "releaseTime": "2023-04-20T17:44:02+00:00",
                "url": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u372-b07/OpenJDK8U-jre_x64_linux_hotspot_8u372b07.tar.gz",
                "vendor": "eclipse",
                "version": {
                    "build": 7,
                    "major": 8,
                    "minor": 0,
                    "security": 372
                }
            },
            {
                "checksum": {
                    "hash": "beed678283c4fb62250c637f2de771c147cce386cd8a9eaddf857715e5749703",
                    "type": "sha256"
                },
                "downloadType": "archive",
                "name": "azul_zulu_jre8.0.372",
                "recommended": false,
                "releaseTime": "2023-04-18T08:33:34+00:00",
                "url": "https://cdn.azul.com/zulu/bin/zulu8.70.0.23-ca-jre8.0.372-linux_x64.zip",
                "vendor": "azul",
                "version": {
                    "major": 8,
                    "minor": 0,
                    "security": 372
                }
            },
        ],
        // ...
    },
    "uid": "net.minecraft.java",
    "version": "java8"
}
Trial97 commented 6 months ago

If we want to only support Mojang Java for starters, commenting out https://github.com/PrismLauncher/meta/blob/abc32095d8fd61ab71c23c4710d41e5755fd9f5a/update.sh#L50 and https://github.com/PrismLauncher/meta/blob/abc32095d8fd61ab71c23c4710d41e5755fd9f5a/update.sh#L59 will make the scripts to not generate adoptium and azul java metadata

Ryex commented 3 months ago

IBM Semeru which used OpenJ9 "which is known to be quite memory efficient, making it potentially interesting for large modpacks." ~ user who wanted detection support.

it may be interesting to add it to meta.

it uses the same api schema as Adoptium so very little work would be required. just use https://api.adoptopenjdk.net as the base and use the query filter

?jvm_impl=openj9&vendor=ibm

Trial97 commented 2 months ago

Right now I think we will not add more java providers until we do a nightly release with adoptium and azulu(to test this out). And I think we can wait until IBM releases its own API as mentioned here: https://github.com/adoptium/api.adoptium.net/issues/187#issuecomment-1083996585 (or they are released under adoptium). Either way in case we need to add that I already have prepared the commit for it: https://github.com/adoptium/api.adoptium.net/issues/187#issuecomment-1083996585

Scrumplex commented 2 months ago

Could you also add the two new entrypoints to tool.poetry.scripts in pyproject.toml?

Scrumplex commented 2 months ago

As it is right now, this downloads an endless supply of Azul JREs/JDKs. I doubt people will use most of these, so perhaps we should have some filters in place?

I'd propose only keeping track of the last let's say 10 versions per major version?

Trial97 commented 2 months ago

I would prefer to keep them but I'm not against fetching less javas. So if you can just push a change here it would be great.

TayouVR commented 2 months ago

just testing, thought I'd have asked in the past to get perms on this repo, but It may have been the website & bot or smth I asked for in the past (I don't really do any meta work)