Class EnhancedPlugin<T>
- Type Parameters:
T- The type of target
- All Implemented Interfaces:
EnhancedPluginAdditions,org.gradle.api.Plugin<T>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnhancedPlugin(String name, String displayName) This constructor must be called by all subclasses using a public constructor annotated withInject.protectedEnhancedPlugin(String name, String displayName, @Nullable String toolsExtName) 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.file.BuildLayoutThe build layout provided by Gradle services.protected abstract org.gradle.jvm.toolchain.JavaToolchainServiceThe Java toolchain service provided by Gradle services.protected abstract org.gradle.api.model.ObjectFactoryThe object factory provided by Gradle services.protected abstract org.gradle.api.file.ProjectLayoutThe project layout provided by Gradle services.protected abstract org.gradle.api.provider.ProviderFactoryThe provider factory provided by Gradle services.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.final org.gradle.api.file.DirectoryPropertyGets the root project directory to be used for this plugin.abstract voidCalled when this plugin is applied to do setup work.final org.gradle.api.file.DirectoryPropertyGets the working project directory to be used for this plugin.
-
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
-
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 plugintoolsExtName- The name for the tools extension to used, ornullif it should not be created
-
-
Method Details
-
getObjects
@Inject protected abstract org.gradle.api.model.ObjectFactory getObjects()The object factory provided by Gradle services.- Returns:
- The object factory
- See Also:
-
getProjectLayout
@Inject protected abstract org.gradle.api.file.ProjectLayout getProjectLayout()The project layout provided by Gradle services.- Returns:
- The build layout
- See Also:
-
getBuildLayout
@Inject protected abstract org.gradle.api.file.BuildLayout getBuildLayout()The build layout provided by Gradle services.- Returns:
- The build layout
- See Also:
-
getProviders
@Inject protected abstract org.gradle.api.provider.ProviderFactory getProviders()The provider factory provided by Gradle services.- Returns:
- The provider factory
- See Also:
-
getJavaToolchains
@Inject protected abstract org.gradle.jvm.toolchain.JavaToolchainService getJavaToolchains()The Java toolchain service provided by Gradle services.- Returns:
- The Java toolchain service
-
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()Description copied from interface:EnhancedPluginAdditionsGets 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.- Specified by:
globalCachesin interfaceEnhancedPluginAdditions- Returns:
- The global caches
-
localCaches
public final org.gradle.api.file.DirectoryProperty localCaches()Description copied from interface:EnhancedPluginAdditionsGets 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.- Specified by:
localCachesin interfaceEnhancedPluginAdditions- Returns:
- The global caches
-
rootProjectDirectory
public final org.gradle.api.file.DirectoryProperty rootProjectDirectory()Description copied from interface:EnhancedPluginAdditionsGets the root project directory to be used for this plugin.
This directory is either the
ProjectLayout.getProjectDirectory()ofProject.getRootProject()or theBuildLayout.getRootDirectory()of theSettings. Attempting to call this when the plugin target is neither type will throw an exception.- Specified by:
rootProjectDirectoryin interfaceEnhancedPluginAdditions- Returns:
- The root project directory
-
workingProjectDirectory
public final org.gradle.api.file.DirectoryProperty workingProjectDirectory()Description copied from interface:EnhancedPluginAdditionsGets the working project directory to be used for this plugin.
This directory is either the
ProjectLayout.getProjectDirectory()of theProjector theBuildLayout.getRootDirectory()of theSettings. Attempting to call this when the plugin target is neither type will throw an exception.- Specified by:
workingProjectDirectoryin interfaceEnhancedPluginAdditions- Returns:
- The working project directory
-