Class SlimeLauncherOptions
- All Implemented Interfaces:
org.gradle.api.Named
The configuration options for Slime Launcher tasks.
The launch tasks generated by the Minecraft extension are specialized
JavaExec tasks that are designed to work with Slime Launcher, Minecraft Forge's
dedicated launcher for the development environment. While the implementing task class remains internal (can still be
configured as type JavaExec), these options exist to allow consumers to alter or add pre-defined attributes to the
run configurations as needed.
For example, changing the main class of the launch task as a
JavaExec task will cause it to not use Slime Launcher and skip its configurations for it. If a consumer wishes to
use Slime Launcher but change the main class it delegates to after initial setup, that can be done using
setMainClass(String) or setMainClass(Provider).
- API Note:
- This class is public-facing as a class instead of an interface to satisfy the requirement that Gradle's
NamedDomainObjectContainermust house a class that implements theNamedinterface. Like the other public-facing interface APIs in ForgeGradle, this class remains sealed and is implemented by a package-private class that cannot be directly accessed.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdds to the arguments to pass to the main class.final voidAdds to the arguments to pass to the main class.final voidAdds to the arguments to pass to the main class.final voidAdds to the arguments to pass to the main class.final voidAdds to the classpath to use.final voidAdds to the classpath to use.final voidclasspath(org.gradle.api.file.FileCollection classpath) Adds to the classpath to use.final voidAdds to the classpath to use.final voidenvironment(String name, Object value) Adds a single environment variable to use.final voidenvironment(Map<String, ?> properties) Adds to the environment variables to use.final voidenvironment(org.gradle.api.provider.Provider<? extends Map<String, ?>> properties) Adds to the environment variables to use.final org.gradle.api.provider.ListProperty<String> getArgs()The arguments to pass to the main class.final org.gradle.api.file.FileCollectionThe classpath to use.The environment variables to use.final org.gradle.api.provider.ListProperty<String> The JVM arguments to use.protected abstract org.gradle.api.file.ProjectLayoutfinal org.gradle.api.provider.Property<String> The main class for Slime Launcher to use.final org.gradle.api.provider.Property<String> The maximum memory heap size to use.final org.gradle.api.provider.Property<String> The minimum memory heap size to use.final StringgetName()The name of the Slime Launcher configuration.protected abstract org.gradle.api.model.ObjectFactoryThe system properties to use.final org.gradle.api.provider.Property<String> The name to use for the Gradle task.final org.gradle.api.file.DirectoryPropertyThe working directory to use.final voidAdds to the JVM arguments to use.final voidAdds to the JVM arguments to use.final voidAdds to the JVM arguments to use.final voidAdds to the JVM arguments to use.final voidSets the arguments to pass to the main class.final voidSets the arguments to pass to the main class.final voidSets the arguments to pass to the main class.final voidsetClasspath(Iterable<?> classpath) Sets the classpath to use.final voidsetClasspath(Object... classpath) Sets the classpath to use.final voidsetClasspath(org.gradle.api.file.FileCollection classpath) Sets the classpath to use.final voidsetClasspath(org.gradle.api.provider.Provider<? extends Iterable<?>> classpath) Sets the classpath to use.final voidsetEnvironment(Map<String, ?> environment) Sets the environment variables to use.final voidsetEnvironment(org.gradle.api.provider.Provider<? extends Map<String, ?>> environment) Sets the environment variables to use.final voidsetJvmArgs(Iterable<String> jvmArgs) Sets the JVM arguments to use.final voidsetJvmArgs(String... jvmArgs) Sets the JVM arguments to use.final voidsetJvmArgs(org.gradle.api.provider.Provider<? extends Iterable<String>> jvmArgs) Sets the JVM arguments to use.final voidsetMainClass(String mainClass) Sets the main class for Slime Launcher to use.final voidsetMainClass(org.gradle.api.provider.Provider<String> mainClass) Sets the main class for Slime Launcher to use.final voidsetMaxHeapSize(String maxHeapSize) Sets the maximum memory heap size to use.final voidsetMaxHeapSize(org.gradle.api.provider.Property<String> maxHeapSize) Sets the maximum memory heap size to use.final voidsetMinHeapSize(String minHeapSize) Sets the minimum memory heap size to use.final voidsetMinHeapSize(org.gradle.api.provider.Property<String> minHeapSize) Sets the minimum memory heap size to use.final voidsetSystemProperties(Map<String, ?> properties) Sets the system properties to use.final voidsetSystemProperties(org.gradle.api.provider.Provider<? extends Map<String, ?>> properties) Sets the system properties to use.final voidsetTaskName(String taskName) Sets the name to use for the Gradle task.final voidsetTaskName(org.gradle.api.provider.Provider<String> taskName) Sets the name to use for the Gradle task.final voidsetWorkingDir(File workingDir) Sets the working directory to use.final voidsetWorkingDir(org.gradle.api.file.Directory workingDir) Sets the working directory to use.final voidsetWorkingDir(org.gradle.api.provider.Provider<? extends org.gradle.api.file.Directory> workingDir) Sets the working directory to use.final voidsystemProperties(Map<String, ?> properties) Adds to the system properties to use.final voidsystemProperties(org.gradle.api.provider.Provider<? extends Map<String, ?>> properties) Adds to the system properties to use.final voidsystemProperty(String name, Object value) Adds a single system property to use.
-
Method Details
-
getName
The name of the Slime Launcher configuration.
Note that this is not the same as the resulting task name. This is what you see when you declare a run configuration in your buildscript.
- Specified by:
getNamein interfaceorg.gradle.api.Named- Returns:
- The name of this configuration
-
getTaskName
The name to use for the Gradle task.
By default, this will be this configuration's name, capitalized, appended to
"run"(i.e. "client" -> "runClient").- Returns:
- A property for the name of the task
-
getMainClass
The main class for Slime Launcher to use.
This is the class that will be invoked by Slime Launcher, not the main class of the
JavaExectask that will be produced from these options.- Returns:
- A property for the main class
-
getArgs
The arguments to pass to the main class.
This is the arguments that will be passed to the main class through Slime Launcher, not the arguments for Slime Launcher itself.
- Returns:
- A property for the arguments to pass to the main class
-
getJvmArgs
The JVM arguments to use.
These are applied immediately when Slime Launcher is executed. A reminder that Slime Launcher is not a re-launcher but a dev-environment bootstrapper.
- Returns:
- A property for the JVM arguments
-
getClasspath
@InputFiles @Optional @Classpath public final org.gradle.api.file.FileCollection getClasspath()The classpath to use.
The classpath in question must include Slime Launcher in it. By default, the minecraft extension adds Slime Launcher as a dependency to the consuming project's runtimeClasspath configuration.
Keep in mind that if the
JavaExectask is configured to have a different main class, the classpath does not need to include Slime Launcher.- Returns:
- The classpath to use
-
getMinHeapSize
The minimum memory heap size to use.
Working with this property is preferred over manually using the
-Xmsargument in the JVM arguments.- Returns:
- A property for the minimum heap size
-
getMaxHeapSize
The maximum memory heap size to use.
Working with this property is preferred over manually using the
-Xmxargument in the JVM arguments.- Returns:
- A property for the maximum heap size
-
getSystemProperties
-
getEnvironment
-
getWorkingDir
@InputDirectory public final org.gradle.api.file.DirectoryProperty getWorkingDir()The working directory to use.
By default, this will be
run/name.To clarify: this is the working directory of the Java process. Slime Launcher uses absolute file locations to place its caches and metadata, which do not interfere with the working directory.
- Returns:
- A property for the working directory
-
setTaskName
Sets the name to use for the Gradle task.- Parameters:
taskName- The name- See Also:
-
setTaskName
Sets the name to use for the Gradle task.- Parameters:
taskName- The name- See Also:
-
setMainClass
Sets the main class for Slime Launcher to use.- Parameters:
mainClass- The main class- See Also:
-
setMainClass
Sets the main class for Slime Launcher to use.- Parameters:
mainClass- The main class- See Also:
-
args
Adds to the arguments to pass to the main class.- Parameters:
args- The arguments to add- See Also:
- API Note:
- To add multiple arguments, use
args(String...)
-
args
Adds to the arguments to pass to the main class.- Parameters:
args- The arguments to add- See Also:
- API Note:
- Unlike
setArgs(String...), this method does not replace the existing arguments.
-
args
Adds to the arguments to pass to the main class.- Parameters:
args- The arguments to add- See Also:
- API Note:
- Unlike
setArgs(Iterable), this method does not replace the existing arguments.
-
args
Adds to the arguments to pass to the main class.- Parameters:
args- The arguments to add- See Also:
- API Note:
- Unlike
setArgs(Provider), this method does not replace the existing arguments.
-
setArgs
Sets the arguments to pass to the main class.- Parameters:
args- The arguments- See Also:
- API Note:
- This method will replace any existing arguments. To add to existing arguments, use
args(String...).
-
setArgs
Sets the arguments to pass to the main class.- Parameters:
args- The arguments- See Also:
- API Note:
- This method will replace any existing arguments. To add to existing arguments, use
args(Iterable).
-
setArgs
Sets the arguments to pass to the main class.- Parameters:
args- The arguments- See Also:
- API Note:
- This method will replace any existing arguments. To add to existing arguments, use
args(Provider).
-
jvmArgs
Adds to the JVM arguments to use.- Parameters:
jvmArgs- The JVM argument to add- See Also:
- API Note:
- To add multiple arguments, use
jvmArgs(String...)
-
jvmArgs
Adds to the JVM arguments to use.- Parameters:
jvmArgs- The JVM arguments to add- See Also:
- API Note:
- Unlike
setJvmArgs(String...), this method does not replace the existing arguments.
-
jvmArgs
Adds to the JVM arguments to use.- Parameters:
jvmArgs- The JVM arguments to add- See Also:
- API Note:
- Unlike
setJvmArgs(Iterable), this method does not replace the existing arguments.
-
jvmArgs
Adds to the JVM arguments to use.- Parameters:
jvmArgs- The JVM arguments to add- See Also:
- API Note:
- Unlike
setJvmArgs(Provider), this method does not replace the existing arguments.
-
setJvmArgs
Sets the JVM arguments to use.- Parameters:
jvmArgs- The arguments- See Also:
- API Note:
- This method will replace any existing arguments. To add to existing arguments, use
jvmArgs(String...).
-
setJvmArgs
Sets the JVM arguments to use.- Parameters:
jvmArgs- The arguments- See Also:
- API Note:
- This method will replace any existing arguments. To add to existing arguments, use
jvmArgs(Iterable).
-
setJvmArgs
Sets the JVM arguments to use.- Parameters:
jvmArgs- The arguments- See Also:
- API Note:
- This method will replace any existing arguments. To add to existing arguments, use
jvmArgs(Provider).
-
classpath
Adds to the classpath to use.- Parameters:
classpath- The classpath to include with the existing classpath- See Also:
- API Note:
- Unlike
setClasspath(Object...), this method does not replace the existing classpath.
-
classpath
Adds to the classpath to use.- Parameters:
classpath- The classpath to include with the existing classpath- See Also:
- API Note:
- Unlike
setClasspath(Iterable), this method does not replace the existing classpath.
-
classpath
Adds to the classpath to use.- Parameters:
classpath- The classpath to include with the existing classpath- See Also:
- API Note:
- Unlike
setClasspath(Provider), this method does not replace the existing classpath.
-
classpath
public final void classpath(org.gradle.api.file.FileCollection classpath) Adds to the classpath to use.- Parameters:
classpath- The classpath to include with the existing classpath- See Also:
- API Note:
- Unlike
setClasspath(FileCollection), this method does not replace the existing classpath.
-
setClasspath
Sets the classpath to use.- Parameters:
classpath- The classpath- See Also:
- API Note:
- This method will replace the existing classpath. To add to it, use
classpath(Object...).
-
setClasspath
Sets the classpath to use.- Parameters:
classpath- The classpath- See Also:
- API Note:
- This method will replace the existing classpath. To add to it, use
classpath(Iterable).
-
setClasspath
Sets the classpath to use.- Parameters:
classpath- The classpath- See Also:
- API Note:
- This method will replace the existing classpath. To add to it, use
classpath(Provider).
-
setClasspath
public final void setClasspath(org.gradle.api.file.FileCollection classpath) Sets the classpath to use.- Parameters:
classpath- The classpath- See Also:
- API Note:
- This method will replace the existing classpath. To add to it, use
classpath(FileCollection).
-
setMinHeapSize
Sets the minimum memory heap size to use.- Parameters:
minHeapSize- The minimum heap size- See Also:
-
setMinHeapSize
Sets the minimum memory heap size to use.- Parameters:
minHeapSize- The minimum heap size- See Also:
-
setMaxHeapSize
Sets the maximum memory heap size to use.- Parameters:
maxHeapSize- The maximum heap size- See Also:
-
setMaxHeapSize
Sets the maximum memory heap size to use.- Parameters:
maxHeapSize- The maximum heap size- See Also:
-
systemProperty
Adds a single system property to use.- Parameters:
name- The namevalue- The value- See Also:
- API Note:
- To add multiple system properties at once, use
systemProperties(Provider).
-
systemProperties
Adds to the system properties to use.- Parameters:
properties- The system properties- See Also:
- API Note:
- Unlike
setSystemProperties(Map), this method does not replace the existing system properties. To add a single property, usesystemProperty(String,Object).
-
systemProperties
public final void systemProperties(org.gradle.api.provider.Provider<? extends Map<String, ?>> properties) Adds to the system properties to use.- Parameters:
properties- The system properties- See Also:
- API Note:
- Unlike
setSystemProperties(Provider), this method does not replace the existing system properties. To add a single property, usesystemProperty(String,Object).
-
setSystemProperties
Sets the system properties to use.- Parameters:
properties- The system properties- See Also:
- API Note:
- This method will replace any existing system properties. To add to them, use
systemProperties(Map)orsystemProperty(String,Object).
-
setSystemProperties
public final void setSystemProperties(org.gradle.api.provider.Provider<? extends Map<String, ?>> properties) Sets the system properties to use.- Parameters:
properties- The system properties- See Also:
- API Note:
- This method will replace any existing system properties. To add to them, use
systemProperties(Provider)orsystemProperty(String,Object).
-
environment
Adds a single environment variable to use.- Parameters:
name- The namevalue- The value- See Also:
- API Note:
- To add multiple environment variables at once, use
environment(Provider).
-
environment
Adds to the environment variables to use.- Parameters:
properties- The environment variables- See Also:
- API Note:
- Unlike
setEnvironment(Map), this method does not replace the existing environment variables. To add a single variable, useenvironment(String,Object).
-
environment
Adds to the environment variables to use.- Parameters:
properties- The environment variables- See Also:
- API Note:
- Unlike
setEnvironment(Provider), this method does not replace the existing environment variables. To add a single variable, useenvironment(String,Object).
-
setEnvironment
Sets the environment variables to use.- Parameters:
environment- The environment variables- See Also:
- API Note:
- This method will replace any existing environment variables. To add to them, use
environment(Map)orenvironment(String,Object).
-
setEnvironment
public final void setEnvironment(org.gradle.api.provider.Provider<? extends Map<String, ?>> environment) Sets the environment variables to use.- Parameters:
environment- The environment variables- See Also:
- API Note:
- This method will replace any existing environment variables. To add to them, use
environment(Provider)orenvironment(String,Object).
-
setWorkingDir
-
setWorkingDir
public final void setWorkingDir(org.gradle.api.file.Directory workingDir) Sets the working directory to use.- Parameters:
workingDir- The working directory- See Also:
-
setWorkingDir
public final void setWorkingDir(org.gradle.api.provider.Provider<? extends org.gradle.api.file.Directory> workingDir) Sets the working directory to use.- Parameters:
workingDir- The working directory- See Also:
- API Note:
- Note that the provider given must hold a
Directory, not a standardFile. If you must use a standard file object, usesetWorkingDir(File).
-
getObjects
-
getLayout
-