Class EnhancedPlugin<T>
java.lang.Object
net.minecraftforge.gradleutils.shared.EnhancedPlugin<T>
- Type Parameters:
T- The type of target
- All Implemented Interfaces:
org.gradle.api.Plugin<T>
@OverrideOnly
public abstract class EnhancedPlugin<T>
extends Object
implements org.gradle.api.Plugin<T>
The enhanced plugin contains several helper members to assist in making Gradle plugins as clean as possible without
needing to duplicate code across projects.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnhancedPlugin(String name, String displayName) This constructor must be called by all subclasses using a public constructor annotated withInject. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidThis method is used by Gradle to apply this plugin.protected abstract org.gradle.api.model.ObjectFactoryprotected abstract org.gradle.api.provider.ProviderFactoryorg.gradle.api.provider.Provider<File> Gets a provider to the file for aToolto be used.final org.gradle.api.file.DirectoryPropertyGets the global caches to be used for this plugin.final org.gradle.api.file.DirectoryPropertyGets the local caches to be used for this plugin.abstract voidCalled when this plugin is applied to do setup work.
-
Constructor Details
-
EnhancedPlugin
This constructor must be called by all subclasses using a public constructor annotated withInject. The name and display name passed in are used in a minimal instance ofEnhancedProblems, which is used to set up the plugin's global and local caches. Additionally, the name is used to create the cache folders (minecraftforge/name).- Parameters:
name- The name for this plugin (must be machine-friendly)displayName- The display name for this plugin
-
-
Method Details
-
getObjects
- See Also:
-
getProviders
- See Also:
-
apply
-
setup
Called when this plugin is applied to do setup work.- Parameters:
target- The target for this plugin (can also get after setup withgetTarget())
-
globalCaches
public final org.gradle.api.file.DirectoryProperty globalCaches()Gets the global caches to be used for this plugin. These caches persist between projects and should be used to eliminate excess work done by projects that request the same data.
It is stored in
~/.gradle/caches/minecraftforge/plugin.- Returns:
- The global caches
- Throws:
RuntimeException- If this plugin cannot access global caches (i.e. the target is notProjectorSettings)
-
localCaches
public final org.gradle.api.file.DirectoryProperty localCaches()Gets the local caches to be used for this plugin. Data done by tasks that should not be shared between projects should be stored here.
It is located in
project/build/minecraftforge/plugin.- Returns:
- The global caches
- Throws:
RuntimeException- If this plugin cannot access global caches (i.e. the target is notProjectorSettings)
-