Class MinecraftExtensionImpl
- java.lang.Object
-
- org.spongepowered.gradle.vanilla.internal.MinecraftExtensionImpl
-
- All Implemented Interfaces:
MinecraftExtension,MinecraftRepositoryExtension
public class MinecraftExtensionImpl extends java.lang.Object implements MinecraftExtension
-
-
Constructor Summary
Constructors Constructor Description MinecraftExtensionImpl(org.gradle.api.invocation.Gradle gradle, org.gradle.api.model.ObjectFactory factory, org.gradle.api.provider.ProviderFactory providers, org.gradle.api.Project project, org.gradle.api.provider.Provider<MinecraftProviderService> providerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.gradle.api.file.ConfigurableFileCollectionaccessWideners()voidaccessWideners(java.lang.Object... files)Apply access wideners to the project.org.gradle.api.file.DirectoryPropertyassetsDirectory()RunConfigurationContainergetRuns()Get run configurations configured for this project.voidinjectedVersion(java.lang.Object versionFile)Use a version derived from a provided file.org.gradle.api.provider.Property<java.lang.Boolean>injectRepositories()Get whether repositories should be injected into the build.voidinjectRepositories(boolean injectRepositories)Set whether standard repositories should be added to the project.java.lang.StringinjectVersion(java.io.File file)Inject a version from the provided filejava.lang.StringinjectVersion(java.lang.String file)Inject a version from the provided filevoidlatestRelease()Set the version of Minecraft used to the latest release.voidlatestSnapshot()Set the version of Minecraft used to the latest snapshot.java.util.Set<ArtifactModifier>modifiers()org.gradle.api.provider.Provider<java.lang.Boolean>needsPrepareWorkspace()org.gradle.api.provider.Property<MinecraftPlatform>platform()Get a property pointing to the Minecraft platform being prepared.voidplatform(MinecraftPlatform platform)Set the platform/environment of Minecraft to prepare.voidruns(groovy.lang.Closure run)Operate on the available run configurations.voidruns(org.gradle.api.Action<RunConfigurationContainer> run)Operate on the available run configurations.org.gradle.api.provider.Provider<VersionDescriptor.Full>targetVersion()org.gradle.api.provider.Property<java.lang.String>version()Get a property pointing to the version of Minecraft to prepare.voidversion(java.lang.String version)Set the version of Minecraft to prepare.
-
-
-
Constructor Detail
-
MinecraftExtensionImpl
@Inject public MinecraftExtensionImpl(org.gradle.api.invocation.Gradle gradle, org.gradle.api.model.ObjectFactory factory, org.gradle.api.provider.ProviderFactory providers, org.gradle.api.Project project, org.gradle.api.provider.Provider<MinecraftProviderService> providerService)
-
-
Method Detail
-
injectRepositories
public org.gradle.api.provider.Property<java.lang.Boolean> injectRepositories()
Description copied from interface:MinecraftRepositoryExtensionGet whether repositories should be injected into the build.For users who run their own proxying repositories or who want to manage repositories in another way, this property can be disabled. However, to function VanillaGradle must be able to resolve artifacts that are present in the following repositories:
This list is subject to change in any feature release without that release being marked as "breaking".
- Specified by:
injectRepositoriesin interfaceMinecraftRepositoryExtension- Returns:
- the inject repositories property
-
injectRepositories
public void injectRepositories(boolean injectRepositories)
Description copied from interface:MinecraftRepositoryExtensionSet whether standard repositories should be added to the project.- Specified by:
injectRepositoriesin interfaceMinecraftRepositoryExtension- Parameters:
injectRepositories- whether repositories should be injected- See Also:
for a list of repositories that are injected
-
injectVersion
public java.lang.String injectVersion(java.lang.String file)
Description copied from interface:MinecraftRepositoryExtensionInject a version from the provided fileThis allows building against Minecraft versions that may not be available in the ordinary version list, such as combat snapshots.
This will override whatever data may be present in the manifest repository
- Specified by:
injectVersionin interfaceMinecraftRepositoryExtension- Parameters:
file- a path relative to the root directory- Returns:
- the ID of the injected version
-
injectVersion
public java.lang.String injectVersion(java.io.File file)
Description copied from interface:MinecraftRepositoryExtensionInject a version from the provided fileThis allows building against Minecraft versions that may not be available in the ordinary version list, such as combat snapshots.
This will override whatever data may be present in the manifest repository
- Specified by:
injectVersionin interfaceMinecraftRepositoryExtension- Parameters:
file- a file to load- Returns:
- the ID of the injected version
-
version
public org.gradle.api.provider.Property<java.lang.String> version()
Description copied from interface:MinecraftExtensionGet a property pointing to the version of Minecraft to prepare.Values of the property are unvalidated!
There is no default value.
- Specified by:
versionin interfaceMinecraftExtension- Returns:
- the version
-
version
public void version(java.lang.String version)
Description copied from interface:MinecraftExtensionSet the version of Minecraft to prepare.This version is only validated when the Minecraft development environment is prepared.
- Specified by:
versionin interfaceMinecraftExtension- Parameters:
version- the minecraft version
-
injectedVersion
public void injectedVersion(java.lang.Object versionFile)
Description copied from interface:MinecraftExtensionUse a version derived from a provided file.This allows building against Minecraft versions that may not be available in the ordinary version list, such as combat snapshots.
- Specified by:
injectedVersionin interfaceMinecraftExtension- Parameters:
versionFile- a file-like object that can be handled byProject.file(Object)
-
latestRelease
public void latestRelease()
Description copied from interface:MinecraftExtensionSet the version of Minecraft used to the latest release.This should only be used in development workspaces or for analysis tools.
- Specified by:
latestReleasein interfaceMinecraftExtension
-
latestSnapshot
public void latestSnapshot()
Description copied from interface:MinecraftExtensionSet the version of Minecraft used to the latest snapshot.This should only be used in development workspaces or for analysis tools.
- Specified by:
latestSnapshotin interfaceMinecraftExtension
-
platform
public org.gradle.api.provider.Property<MinecraftPlatform> platform()
Description copied from interface:MinecraftExtensionGet a property pointing to the Minecraft platform being prepared.Default:
JOINED- Specified by:
platformin interfaceMinecraftExtension- Returns:
- the platform property
-
platform
public void platform(MinecraftPlatform platform)
Description copied from interface:MinecraftExtensionSet the platform/environment of Minecraft to prepare.- Specified by:
platformin interfaceMinecraftExtension- Parameters:
platform- the platform
-
accessWideners
public void accessWideners(java.lang.Object... files)
Description copied from interface:MinecraftExtensionApply access wideners to the project.Access wideners can only be added before the first time a Minecraft dependency is resolved.
- Specified by:
accessWidenersin interfaceMinecraftExtension- Parameters:
files- any file that can be passed toProject.file(Object)
-
accessWideners
public org.gradle.api.file.ConfigurableFileCollection accessWideners()
-
modifiers
public java.util.Set<ArtifactModifier> modifiers()
-
assetsDirectory
public org.gradle.api.file.DirectoryProperty assetsDirectory()
-
getRuns
public RunConfigurationContainer getRuns()
Description copied from interface:MinecraftExtensionGet run configurations configured for this project.Every run configuration will automatically have Minecraft on its classpath.
- Specified by:
getRunsin interfaceMinecraftExtension- Returns:
- the run configuration.
-
runs
public void runs(@DelegatesTo(value=RunConfigurationContainer.class,strategy=1) groovy.lang.Closure run)
Description copied from interface:MinecraftExtensionOperate on the available run configurations.- Specified by:
runsin interfaceMinecraftExtension- Parameters:
run- a closure operating on the run configuration container
-
runs
public void runs(org.gradle.api.Action<RunConfigurationContainer> run)
Description copied from interface:MinecraftExtensionOperate on the available run configurations.- Specified by:
runsin interfaceMinecraftExtension- Parameters:
run- an action operating on the run configuration container
-
targetVersion
public org.gradle.api.provider.Provider<VersionDescriptor.Full> targetVersion()
-
needsPrepareWorkspace
public org.gradle.api.provider.Provider<java.lang.Boolean> needsPrepareWorkspace()
-
-