Class LoomGradleExtensionApiImpl
- All Implemented Interfaces:
LoomGradleExtensionAPI
- Direct Known Subclasses:
LoomGradleExtensionImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.gradle.api.file.RegularFilePropertyprotected final org.gradle.api.provider.Property<String> static final Stringprotected final DeprecationHelperprotected final org.gradle.api.file.RegularFilePropertyprotected booleanprotected final org.gradle.api.provider.Property<String> protected final org.gradle.api.provider.Property<IntermediateMappingsProvider> protected final org.gradle.api.provider.ListProperty<JarProcessor> Deprecated.protected final org.gradle.api.provider.SetProperty<String> protected final Map<LayeredMappingSpec, LayeredMappingsFactory> protected final ThreadLocal<Boolean> protected final org.gradle.api.file.ConfigurableFileCollectionprotected final org.gradle.api.provider.Property<Boolean> protected final org.gradle.api.provider.ListProperty<RemapperExtensionHolder> final List<Consumer<RunConfiguration>> protected final org.gradle.api.provider.Property<Boolean> protected final ManifestLocations -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLoomGradleExtensionApiImpl(org.gradle.api.Project project, LoomFiles directories) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMinecraftJarProcessor(Class<? extends MinecraftJarProcessor<?>> clazz, Object... parameters) addRemapConfiguration(String name, org.gradle.api.Action<RemapConfigurationSettings> action) <T extends RemapperParameters>
voidaddRemapperExtension(Class<? extends RemapperExtension<T>> remapperExtensionClass, Class<T> parametersClass, org.gradle.api.Action<T> parameterAction) booleanprotected abstract <T extends IntermediateMappingsProvider>
voidconfigureIntermediateMappingsProviderInternal(T provider) voidcreateRemapConfigurations(org.gradle.api.tasks.SourceSet sourceSet) voiddecompilers(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<DecompilerOptions>> action) voiddisableDeprecatedPomGeneration(org.gradle.api.publish.maven.MavenPublication publication) Disables the deprecated POM generation for a publication.voidforge(org.gradle.api.Action<ForgeExtensionAPI> action) org.gradle.api.file.RegularFilePropertyorg.gradle.api.provider.Property<String> org.gradle.api.NamedDomainObjectContainer<DecompilerOptions> getDecompileTask(DecompilerOptions options, boolean client) Returns theGenerateSourcesTaskfor the givenDecompilerOptions.org.gradle.api.provider.Property<String> org.gradle.api.provider.Property<Boolean> When true loom will apply mod provided javadoc from dependencies.org.gradle.api.provider.Property<Boolean> When true loom will apply transitive access wideners from compile dependencies.org.gradle.api.file.RegularFilePropertySpecifies thefabric.mod.jsonfile location used in injected interface processing.protected abstract LoomFilesgetFiles()org.gradle.api.provider.ListProperty<JarProcessor> org.gradle.api.provider.Property<String> Use "%1$s" as a placeholder for the minecraft version.org.gradle.api.provider.SetProperty<String> org.gradle.api.file.ConfigurableFileCollectionReturns the tiny mappings file used to remap the game and mods.org.gradle.api.provider.Property<MinecraftJarConfiguration<?, ?, ?>> org.gradle.api.provider.ListProperty<MinecraftJarProcessor<?>> org.gradle.api.provider.Provider<String> org.gradle.api.NamedDomainObjectContainer<ModSettings> getMods()Reads the mod version from the fabric.mod.json file located in the main sourcesets resources.org.gradle.api.file.FileCollectionorg.gradle.api.provider.Provider<ModPlatform> org.gradle.api.provider.Property<String> Returns the production namespace — the intermediary-like namespace that the processed Minecraft jar and mod dependencies are in before being remapped to named.protected abstract org.gradle.api.Projectorg.gradle.api.NamedDomainObjectList<RemapConfigurationSettings> org.gradle.api.provider.Property<Boolean> When enabled, Loom remaps JSRNullable,Nonnull, andImmutableannotations to their JetBrains counterparts in the Minecraft JAR.org.gradle.api.NamedDomainObjectContainer<RunConfigSettings> org.gradle.api.provider.Property<Boolean> org.gradle.api.provider.Property<Boolean> When enabled, lwjgl-opengl or lwjgl-vulkan will be added as a runtime dependency preventing the mod from compiling against a specific graphics API.org.gradle.api.provider.Property<Boolean> org.gradle.api.provider.Property<Boolean> Whether to transform zip entries within nested jars to be using STORED compression.org.gradle.api.provider.Property<Boolean> voidinjectAccessWidener(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, Object accessWidenerFile) Injects an access widener or class tweaker file into the specified jar and adds it to the mod metadata file.booleanorg.gradle.api.artifacts.Dependencylayered(org.gradle.api.Action<LayeredMappingSpecBuilder> action) voidmixin(org.gradle.api.Action<MixinExtensionAPI> action) voidmods(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<ModSettings>> action) Optionally register and configure aModSettingsobject.voidneoForge(org.gradle.api.Action<NeoForgeExtensionAPI> action) voidnestJars(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.artifacts.Configuration configuration) Includes dependencies from a configuration in the specified jar task.voidnestJars(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.file.FileCollection jars) Nest mod jars from aFileCollectioninto the specified jar task.voidnestJars(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.NamedDomainObjectProvider<? extends org.gradle.api.artifacts.Configuration> configuration) Includes dependencies from a lazily provided configuration in the specified jar task.org.gradle.api.artifacts.Dependencyvoidruns(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<RunConfigSettings>> action) voidsetGenerateSrgTiny(Boolean generateSrgTiny) <T extends IntermediateMappingsProvider>
voidsetIntermediateMappingsProvider(Class<T> clazz, org.gradle.api.Action<T> action) voidsetIntermediateMappingsProvider(IntermediateMappingsProvider intermediateMappingsProvider) booleanvoidvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fabricmc.loom.api.LoomGradleExtensionAPI
addJarProcessor, addTaskBeforeRun, clientOnlyMinecraftJar, getCompileRemapConfigurations, getCustomMinecraftManifest, getForge, getMixin, getNeoForge, getRuns, getRuntimeRemapConfigurations, injectAccessWidener, interfaceInjection, isForge, isForgeLike, isNeoForge, isQuilt, noIntermediateMappings, serverOnlyMinecraftJar, splitMinecraftJar, versionsManifests
-
Field Details
-
deprecationHelper
-
jarProcessors
Deprecated. -
log4jConfigs
protected final org.gradle.api.file.ConfigurableFileCollection log4jConfigs -
accessWidener
protected final org.gradle.api.file.RegularFileProperty accessWidener -
fabricModJsonPath
protected final org.gradle.api.file.RegularFileProperty fabricModJsonPath -
versionsManifests
-
customMetadata
-
knownIndyBsms
-
transitiveAccessWideners
-
modProvidedJavadoc
-
intermediary
-
intermediateMappingsProvider
protected final org.gradle.api.provider.Property<IntermediateMappingsProvider> intermediateMappingsProvider -
remapperExtensions
-
layeredSpecBuilderScope
-
DEFAULT_INTERMEDIARY_URL
- See Also:
-
hasEvaluatedLayeredMappings
protected boolean hasEvaluatedLayeredMappings -
layeredMappingsDependencyMap
-
generateSrgTiny
-
settingsPostEdit
-
-
Constructor Details
-
LoomGradleExtensionApiImpl
-
-
Method Details
-
getDeprecationHelper
- Specified by:
getDeprecationHelperin interfaceLoomGradleExtensionAPI
-
getAccessWidenerPath
public org.gradle.api.file.RegularFileProperty getAccessWidenerPath()- Specified by:
getAccessWidenerPathin interfaceLoomGradleExtensionAPI
-
getFabricModJsonPath
public org.gradle.api.file.RegularFileProperty getFabricModJsonPath()Description copied from interface:LoomGradleExtensionAPISpecifies thefabric.mod.jsonfile location used in injected interface processing.By default, either
src/main/resources/fabric.mod.jsonorsrc/client/resources/fabric.mod.jsonin the project directory is used.Providing a path to a different location allows using a shared or preprocessed file. However, at the end it must be put into the root of the processed resources directory (usually
build/resources/main).- Specified by:
getFabricModJsonPathin interfaceLoomGradleExtensionAPI
-
getDecompilerOptions
- Specified by:
getDecompilerOptionsin interfaceLoomGradleExtensionAPI
-
decompilers
public void decompilers(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<DecompilerOptions>> action) - Specified by:
decompilersin interfaceLoomGradleExtensionAPI
-
getGameJarProcessors
- Specified by:
getGameJarProcessorsin interfaceLoomGradleExtensionAPI
-
getMinecraftJarProcessors
- Specified by:
getMinecraftJarProcessorsin interfaceLoomGradleExtensionAPI
-
addMinecraftJarProcessor
public void addMinecraftJarProcessor(Class<? extends MinecraftJarProcessor<?>> clazz, Object... parameters) - Specified by:
addMinecraftJarProcessorin interfaceLoomGradleExtensionAPI
-
officialMojangMappings
public org.gradle.api.artifacts.Dependency officialMojangMappings()- Specified by:
officialMojangMappingsin interfaceLoomGradleExtensionAPI
-
layered
public org.gradle.api.artifacts.Dependency layered(org.gradle.api.Action<LayeredMappingSpecBuilder> action) - Specified by:
layeredin interfaceLoomGradleExtensionAPI
-
runs
public void runs(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<RunConfigSettings>> action) - Specified by:
runsin interfaceLoomGradleExtensionAPI
-
getRunConfigs
- Specified by:
getRunConfigsin interfaceLoomGradleExtensionAPI
-
getLog4jConfigs
public org.gradle.api.file.ConfigurableFileCollection getLog4jConfigs()- Specified by:
getLog4jConfigsin interfaceLoomGradleExtensionAPI
-
mixin
- Specified by:
mixinin interfaceLoomGradleExtensionAPI
-
getVersionsManifests
- Specified by:
getVersionsManifestsin interfaceLoomGradleExtensionAPI
-
getCustomMinecraftMetadata
- Specified by:
getCustomMinecraftMetadatain interfaceLoomGradleExtensionAPI
-
getKnownIndyBsms
- Specified by:
getKnownIndyBsmsin interfaceLoomGradleExtensionAPI
-
getModVersion
Description copied from interface:LoomGradleExtensionAPIReads the mod version from the fabric.mod.json file located in the main sourcesets resources. This is useful if you want to set the gradle version based of the version in the fabric.mod.json file.- Specified by:
getModVersionin interfaceLoomGradleExtensionAPI- Returns:
- the version defined in the fabric.mod.json
-
getEnableTransitiveAccessWideners
Description copied from interface:LoomGradleExtensionAPIWhen true loom will apply transitive access wideners from compile dependencies.- Specified by:
getEnableTransitiveAccessWidenersin interfaceLoomGradleExtensionAPI- Returns:
- the property controlling the transitive access wideners
-
getEnableModProvidedJavadoc
Description copied from interface:LoomGradleExtensionAPIWhen true loom will apply mod provided javadoc from dependencies.- Specified by:
getEnableModProvidedJavadocin interfaceLoomGradleExtensionAPI- Returns:
- the property controlling the mod provided javadoc
-
getProject
protected abstract org.gradle.api.Project getProject() -
getFiles
-
getIntermediaryUrl
Description copied from interface:LoomGradleExtensionAPIUse "%1$s" as a placeholder for the minecraft version.- Specified by:
getIntermediaryUrlin interfaceLoomGradleExtensionAPI- Returns:
- the intermediary url template
-
getProductionNamespace
Description copied from interface:LoomGradleExtensionAPIReturns the production namespace — the intermediary-like namespace that the processed Minecraft jar and mod dependencies are in before being remapped to named.This serves as the source namespace for all remapping operations on both the Minecraft jar (access wideners, interface injection, javadoc) and mod dependencies.
Values:
- Fabric/Quilt (normal versions):
intermediary - Forge (before 1.20.6):
srg - NeoForge and Forge (1.20.6+):
mojang - All platforms (unobfuscated 1.21.11+):
official
- Specified by:
getProductionNamespacein interfaceLoomGradleExtensionAPI- Returns:
- the production namespace property
- Fabric/Quilt (normal versions):
-
getUseIntermediateMappings
- Specified by:
getUseIntermediateMappingsin interfaceLoomGradleExtensionAPI- Returns:
- whether to use intermediate mappings
-
getDefaultMixinRemapType
- Specified by:
getDefaultMixinRemapTypein interfaceLoomGradleExtensionAPI- Returns:
- the default mixin remap type
-
getIntermediateMappingsProvider
- Specified by:
getIntermediateMappingsProviderin interfaceLoomGradleExtensionAPI
-
setIntermediateMappingsProvider
public void setIntermediateMappingsProvider(IntermediateMappingsProvider intermediateMappingsProvider) - Specified by:
setIntermediateMappingsProviderin interfaceLoomGradleExtensionAPI
-
setIntermediateMappingsProvider
public <T extends IntermediateMappingsProvider> void setIntermediateMappingsProvider(Class<T> clazz, org.gradle.api.Action<T> action) - Specified by:
setIntermediateMappingsProviderin interfaceLoomGradleExtensionAPI
-
getMappingsFile
Description copied from interface:LoomGradleExtensionAPIReturns the tiny mappings file used to remap the game and mods.- Specified by:
getMappingsFilein interfaceLoomGradleExtensionAPI- Returns:
- the mappings file, or null if in a non-obfuscated environment
-
getDecompileTask
Description copied from interface:LoomGradleExtensionAPIReturns theGenerateSourcesTaskfor the givenDecompilerOptions. When env source sets are split and the client param is true the decompile task for the client jar will be returned.- Specified by:
getDecompileTaskin interfaceLoomGradleExtensionAPI
-
configureIntermediateMappingsProviderInternal
protected abstract <T extends IntermediateMappingsProvider> void configureIntermediateMappingsProviderInternal(T provider) -
disableDeprecatedPomGeneration
public void disableDeprecatedPomGeneration(org.gradle.api.publish.maven.MavenPublication publication) Description copied from interface:LoomGradleExtensionAPIDisables the deprecated POM generation for a publication. This is useful if you want to suppress deprecation warnings when you're not using software components.Experimental API: Will be removed in Loom 0.12 together with the deprecated POM generation functionality.
- Specified by:
disableDeprecatedPomGenerationin interfaceLoomGradleExtensionAPI- Parameters:
publication- the maven publication
-
getMinecraftJarConfiguration
public org.gradle.api.provider.Property<MinecraftJarConfiguration<?,?, getMinecraftJarConfiguration()?>> - Specified by:
getMinecraftJarConfigurationin interfaceLoomGradleExtensionAPI
-
getRemapJsrAnnotationsToJetBrains
Description copied from interface:LoomGradleExtensionAPIWhen enabled, Loom remaps JSRNullable,Nonnull, andImmutableannotations to their JetBrains counterparts in the Minecraft JAR.When disabled, Loom keeps JSR annotations as-is, and remaps any JetBrains
Nullable,NotNull, andUnmodifiableannotations to their JSR counterparts in the Minecraft JAR.This has no effect on Minecraft versions that solely use JSpecify annotations.
Default: true
- Specified by:
getRemapJsrAnnotationsToJetBrainsin interfaceLoomGradleExtensionAPI- Returns:
- the property controlling the remapping of JSR annotations
-
getRuntimeOnlyLog4j
- Specified by:
getRuntimeOnlyLog4jin interfaceLoomGradleExtensionAPI
-
getRuntimeOnlyLwjglGraphics
Description copied from interface:LoomGradleExtensionAPIWhen enabled, lwjgl-opengl or lwjgl-vulkan will be added as a runtime dependency preventing the mod from compiling against a specific graphics API.- Specified by:
getRuntimeOnlyLwjglGraphicsin interfaceLoomGradleExtensionAPI
-
getSplitModDependencies
- Specified by:
getSplitModDependenciesin interfaceLoomGradleExtensionAPI
-
getUncompressNestedJars
Description copied from interface:LoomGradleExtensionAPIWhether to transform zip entries within nested jars to be using STORED compression.This will usually reduce the resulting jar size by avoiding double-compression.
However, this will very likely increase the decompressed size during runtime as a side effect.
Default: false
- Specified by:
getUncompressNestedJarsin interfaceLoomGradleExtensionAPI- Returns:
- the property controlling this toggle
-
splitEnvironmentSourceSets
public void splitEnvironmentSourceSets()- Specified by:
splitEnvironmentSourceSetsin interfaceLoomGradleExtensionAPI
-
areEnvironmentSourceSetsSplit
public boolean areEnvironmentSourceSetsSplit()- Specified by:
areEnvironmentSourceSetsSplitin interfaceLoomGradleExtensionAPI
-
getInterfaceInjection
- Specified by:
getInterfaceInjectionin interfaceLoomGradleExtensionAPI
-
mods
public void mods(org.gradle.api.Action<org.gradle.api.NamedDomainObjectContainer<ModSettings>> action) Description copied from interface:LoomGradleExtensionAPIOptionally register and configure aModSettingsobject. The name should match the modid. This is generally only required when the mod spans across multiple classpath directories, such as when using split sourcesets.- Specified by:
modsin interfaceLoomGradleExtensionAPI
-
getMods
- Specified by:
getModsin interfaceLoomGradleExtensionAPI
-
getRemapConfigurations
- Specified by:
getRemapConfigurationsin interfaceLoomGradleExtensionAPI
-
addRemapConfiguration
public RemapConfigurationSettings addRemapConfiguration(String name, org.gradle.api.Action<RemapConfigurationSettings> action) - Specified by:
addRemapConfigurationin interfaceLoomGradleExtensionAPI
-
createRemapConfigurations
public void createRemapConfigurations(org.gradle.api.tasks.SourceSet sourceSet) - Specified by:
createRemapConfigurationsin interfaceLoomGradleExtensionAPI
-
addRemapperExtension
public <T extends RemapperParameters> void addRemapperExtension(Class<? extends RemapperExtension<T>> remapperExtensionClass, Class<T> parametersClass, org.gradle.api.Action<T> parameterAction) - Specified by:
addRemapperExtensionin interfaceLoomGradleExtensionAPI
-
getMinecraftVersion
- Specified by:
getMinecraftVersionin interfaceLoomGradleExtensionAPI- Returns:
- The minecraft version, as a
Provider.
-
getNamedMinecraftJars
public org.gradle.api.file.FileCollection getNamedMinecraftJars()- Specified by:
getNamedMinecraftJarsin interfaceLoomGradleExtensionAPI- Returns:
- A lazily evaluated
FileCollectioncontaining the named minecraft jars.
-
nestJars
public void nestJars(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.file.FileCollection jars) Description copied from interface:LoomGradleExtensionAPINest mod jars from aFileCollectioninto the specified jar task. This is useful for including locally built mod jars or jars that don't come from Maven.Important: The jars must already be valid mod jars (containing a fabric.mod.json file). Non-mod jars will be rejected.
Example usage:
loom { nestJars(tasks.jar, files('local-mod.jar')) nestJars(tasks.remapJar, tasks.named('buildOtherMod')) }- Specified by:
nestJarsin interfaceLoomGradleExtensionAPI- Parameters:
jarTask- the jar task to nest jars into (can be jar or remapJar)jars- the file collection containing mod jars to nest
-
nestJars
public void nestJars(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.artifacts.Configuration configuration) Description copied from interface:LoomGradleExtensionAPIIncludes dependencies from a configuration in the specified jar task.This is the task-bound equivalent of the default
includeconfiguration. Dependencies are converted to nestable jars before they are nested into the jar task.Example usage:
loom { nestJars(tasks.jar, configurations.myInclude) nestJars(tasks.named('remapJar'), configurations.named('myRemapInclude')) }- Specified by:
nestJarsin interfaceLoomGradleExtensionAPI- Parameters:
jarTask- the jar task to include dependencies inconfiguration- the configuration containing dependencies to include
-
nestJars
public void nestJars(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.NamedDomainObjectProvider<? extends org.gradle.api.artifacts.Configuration> configuration) Description copied from interface:LoomGradleExtensionAPIIncludes dependencies from a lazily provided configuration in the specified jar task.- Specified by:
nestJarsin interfaceLoomGradleExtensionAPI- Parameters:
jarTask- the jar task to include dependencies inconfiguration- the lazy configuration containing dependencies to include
-
silentMojangMappingsLicense
public void silentMojangMappingsLicense()- Specified by:
silentMojangMappingsLicensein interfaceLoomGradleExtensionAPI
-
isSilentMojangMappingsLicenseEnabled
public boolean isSilentMojangMappingsLicenseEnabled()- Specified by:
isSilentMojangMappingsLicenseEnabledin interfaceLoomGradleExtensionAPI
-
getPlatform
- Specified by:
getPlatformin interfaceLoomGradleExtensionAPI
-
setGenerateSrgTiny
- Specified by:
setGenerateSrgTinyin interfaceLoomGradleExtensionAPI
-
shouldGenerateSrgTiny
public boolean shouldGenerateSrgTiny()- Specified by:
shouldGenerateSrgTinyin interfaceLoomGradleExtensionAPI
-
getTasksBeforeRun
- Specified by:
getTasksBeforeRunin interfaceLoomGradleExtensionAPI
-
getSettingsPostEdit
- Specified by:
getSettingsPostEditin interfaceLoomGradleExtensionAPI
-
forge
- Specified by:
forgein interfaceLoomGradleExtensionAPI
-
neoForge
- Specified by:
neoForgein interfaceLoomGradleExtensionAPI
-
injectAccessWidener
public void injectAccessWidener(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, Object accessWidenerFile) Description copied from interface:LoomGradleExtensionAPIInjects an access widener or class tweaker file into the specified jar and adds it to the mod metadata file.Only the access widener file name is considered; it will be placed top-level in the mod jar.
Only one injected access widener or class tweaker is supported per jar task. When using this API with obfuscated Minecraft versions, the target task must be a
RemapJarTaskso that the access widener gets remapped properly.This method only works in Fabric and Quilt mods.
- Specified by:
injectAccessWidenerin interfaceLoomGradleExtensionAPI- Parameters:
jarTask- the task to inject toaccessWidenerFile- the access widener file, resolved as perProject.file(Object)- See Also:
-