Class BundlerMetadata
- java.lang.Object
-
- org.spongepowered.gradle.vanilla.internal.bundler.BundlerMetadata
-
@Immutable public abstract class BundlerMetadata extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description BundlerMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.Set<BundleElement>libraries()Libraries packed in the jar as dependencies for the server.abstract @Nullable java.lang.StringmainClass()The main class to execute.static BundlerMetadataof(FormatVersion version, java.util.Set<BundleElement> libraries, BundleElement server, @Nullable java.lang.String mainClass)static java.util.Optional<BundlerMetadata>read(java.nio.file.Path jar)Attempt to read bundler metadata from a jar.static java.util.Optional<BundlerMetadata>read(java.util.jar.JarFile file)Attempt to read bundler metadata from a jar.abstract BundleElementserver()Get a bundle element describing the server itself.abstract FormatVersionversion()The bundler format used by this jar.
-
-
-
Method Detail
-
read
public static java.util.Optional<BundlerMetadata> read(java.nio.file.Path jar) throws java.io.IOException
Attempt to read bundler metadata from a jar.If the jar is not a Minecraft bundler jar, an empty
Optionalwill be returned.- Parameters:
jar- the jar to read- Returns:
- parsed metadata
- Throws:
java.io.IOException- if an error occurs while trying to read from the jar
-
read
public static java.util.Optional<BundlerMetadata> read(java.util.jar.JarFile file) throws java.io.IOException
Attempt to read bundler metadata from a jar.If the jar is not a Minecraft bundler jar, an empty
Optionalwill be returned.- Parameters:
file- the jar to read- Returns:
- parsed metadata
- Throws:
java.io.IOException- if an error occurs while trying to read from the jar
-
of
public static BundlerMetadata of(FormatVersion version, java.util.Set<BundleElement> libraries, BundleElement server, @Nullable java.lang.String mainClass)
-
version
@Parameter public abstract FormatVersion version()
The bundler format used by this jar.While VanillaGradle only knows about versions that existed at the time of its release, we will attempt to read future versions as well.
- Returns:
- the format version
-
libraries
@Parameter public abstract java.util.Set<BundleElement> libraries()
Libraries packed in the jar as dependencies for the server.- Returns:
- the library elements
-
server
@Parameter public abstract BundleElement server()
Get a bundle element describing the server itself.- Returns:
- an index entry describing the server
-
mainClass
@Parameter public abstract @Nullable java.lang.String mainClass()
The main class to execute.- Returns:
- the main class
-
-