Class ArtifactAccessTransformer
java.lang.Object
net.minecraftforge.accesstransformers.gradle.ArtifactAccessTransformer
- All Implemented Interfaces:
TransformAction<ArtifactAccessTransformer.Parameters>
public abstract class ArtifactAccessTransformer
extends Object
implements TransformAction<ArtifactAccessTransformer.Parameters>
Transforms artifacts using AccessTransformers.
In ForgeGradle, this is only applied to the Minecraft classes artifact. It can, however, be apoplied to any artifact as long as it is a jar file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe parameters for the transform action. -
Constructor Summary
ConstructorsConstructorDescriptionArtifactAccessTransformer(ExecOperations execOperations) The default constructor that is invoked by Gradle to instantiate this transform action. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Provider<FileSystemLocation> The artifact to transform with AccessTransformers.voidtransform(TransformOutputs outputs) Runs the transform action on the input artifact, queuing it for transformation with AccessTransformers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.artifacts.transform.TransformAction
getParameters
-
Constructor Details
-
ArtifactAccessTransformer
The default constructor that is invoked by Gradle to instantiate this transform action.- Parameters:
execOperations- The exec operations used by this transform action
-
-
Method Details
-
getInputArtifact
The artifact to transform with AccessTransformers.- Returns:
- A property for the input artifact
-
transform
Runs the transform action on the input artifact, queuing it for transformation with AccessTransformers.
There are a few key distinctions that set this transform action apart from more traditional actions in Gradle and other plugins:
- If the AccessTransformers configuration is unspecified or does not
exist, this transformation is skipped entirely.
- Gradle detects changes to this file, so if it is changed, this transform action will be invoked by Gradle.
- This transformer uses in-house caching to detect if the input artifact actually needs to be transformed in the
first place.
- If caches are hit and an existing output is found, the transformation process is skipped entirely.
- Due to Gradle using transient caching for its artifact transforms, this is required to avoid unnecessarily jar transformations, lengthening the build/sync time.
- Specified by:
transformin interfaceTransformAction<ArtifactAccessTransformer.Parameters>- Parameters:
outputs- The outputs for this transform action
- If the AccessTransformers configuration is unspecified or does not
exist, this transformation is skipped entirely.
-