Class LibraryJson
java.lang.Object
com.cleanroommc.gradle.api.util.dist.LibraryJson
Turns resolved artifacts into the library entries launchers understand.
Both the MMC pack and the installer profile describe the same dependency set in two dialects of the same JSON.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Artifactartifact(Coordinate coordinate, Path path, String url) static StringartifactUrl(Coordinate coordinate, Map<String, String> repositories) Longest matching group prefix wins with*being the fallback.static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectembeddedLibrary(Artifact artifact) A library entry whose file the installer embeds rather than downloads.static booleanAn artifact with no download url is one whose file travels inside the archive.static booleanisNative(Coordinate coordinate) static com.google.gson.JsonObjectlocalLibrary(Artifact artifact) A library both MultiMC and Prism take from the instance's ownlibraries/folder instead of downloading.static com.google.gson.JsonArraymmcLibraries(List<Artifact> artifacts) The MultiMC/Prism dialect: Natives are folded into their base module underclassifierswith anativesplatform map.static com.google.gson.JsonArraymojangLibraries(List<Artifact> artifacts) The Mojang dialect used byversion.json: One flat entry per artifact, natives included, ordinary entries carries their classifiers in their names.static com.google.gson.JsonObjectnativeLibrary(Coordinate base, List<Artifact> artifacts) static StringnativePlatform(String classifier) static com.google.gson.JsonObjectordinaryLibrary(Artifact artifact) resolve(Artifact universal, List<? extends LibraryArtifact> libraries, Set<String> inherited, Map<String, String> repositories) Resolves the library inputs into a deterministic, deduplicated artifact list.static StringtrailingSlash(String value)
-
Method Details
-
resolve
public static List<Artifact> resolve(Artifact universal, List<? extends LibraryArtifact> libraries, Set<String> inherited, Map<String, String> repositories) Resolves the library inputs into a deterministic, deduplicated artifact list.- Parameters:
universal- the loader's own jar, always listed firstinherited- coordinates the parent component already supplies, which are skippedrepositories- group prefix to base URL, with*as the fallback
-
mmcLibraries
-
mojangLibraries
-
embeddedLibrary
A library entry whose file the installer embeds rather than downloads. -
ordinaryLibrary
-
localLibrary
A library both MultiMC and Prism take from the instance's ownlibraries/folder instead of downloading. The launcher matches it by bare file name, and never issues a download for it, so the entry carries no url. -
isLocal
An artifact with no download url is one whose file travels inside the archive. -
nativeLibrary
-
download
- Parameters:
withPath- whether to include thepathkey, which Mojang's format carries but not MMC's format
-
artifact
-
artifactUrl
Longest matching group prefix wins with*being the fallback. -
nativePlatform
-
isNative
-
trailingSlash
-