Class LibraryJson
java.lang.Object
com.cleanroommc.gradle.api.util.dist.LibraryJson
Turns resolved artifacts into the library entries launchers understand.
The MMC pack and the installer profile are two dialects of the same JSON. MMC writes the overlay on top of Minecraft 1.12.2, whereas the installer list is self-contained.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Artifactartifact(Coordinate coordinate, Path path, String url) static com.google.gson.JsonObjectThe download block an artifact's entry carries.static 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 booleanisLocalRepository(String url) 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.jsonfor classpath libraries: One flat entry per artifact, classifiers in the name, including side-less native jars such as Netty's.static com.google.gson.JsonArraymojangNativeLibraries(List<Artifact> artifacts) The Mojang dialect for natives: One entry per classifier with a platform rule, extracted rather than classpathed.static StringnativePlatform(String classifier) static com.google.gson.JsonObjectordinaryLibrary(Artifact artifact) resolve(Artifact universal, List<? extends LibraryArtifact> libraries) Resolves a component's libraries with the Cleanroom universal artifact included.resolve(List<? extends LibraryArtifact> libraries, Set<String> inherited) Resolves a component's libraries without adding the Cleanroom universal artifact.static StringtrailingSlash(String value)
-
Method Details
-
resolve
-
resolve
public static List<Artifact> resolve(Artifact universal, List<? extends LibraryArtifact> libraries, Set<String> inherited) Resolves a component's libraries with the Cleanroom universal artifact included.- Parameters:
universal- the universal artifact the component publisheslibraries- the component's declared librariesinherited- coordinates the parent component already supplies, which are skipped
-
resolve
public static List<Artifact> resolve(List<? extends LibraryArtifact> libraries, Set<String> inherited) Resolves a component's libraries without adding the Cleanroom universal artifact.- Parameters:
libraries- the component's declared librariesinherited- coordinates a parent component already supplies, which are skipped
-
mmcLibraries
-
mojangLibraries
The Mojang dialect used byversion.jsonfor classpath libraries: One flat entry per artifact, classifiers in the name, including side-less native jars such as Netty's.- Parameters:
artifacts- the resolved artifacts to write
-
mojangNativeLibraries
The Mojang dialect for natives: One entry per classifier with a platform rule, extracted rather than classpathed. Separate entries are required because the published classifier names do not share a usable${arch}template.- Parameters:
artifacts- the resolved native artifacts to write
-
embeddedLibrary
A library entry whose file the installer embeds rather than downloads.- Parameters:
artifact- the artifact the entry describes
-
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.- Parameters:
artifact- the artifact the entry describes
-
isLocal
An artifact with no download url is one whose file travels inside the archive.- Parameters:
artifact- the artifact to test
-
isLocalRepository
-
download
The download block an artifact's entry carries.- Parameters:
artifact- the artifact the block describeswithPath- whether to include thepathkey, which Mojang's format carries but not MMC's format
-
artifact
-
nativePlatform
-
isNative
-
trailingSlash
-