Interface EnhancedPluginAdditions

All Known Subinterfaces:
EnhancedTask<P>
All Known Implementing Classes:
EnhancedPlugin, ToolExecBase

public sealed interface EnhancedPluginAdditions permits EnhancedPlugin<T>, EnhancedTask<P>
This interface defines the additional methods added by EnhancedPlugin. They are additionally accessible in tasks that implement EnhancedTask.
  • Method Summary

    Modifier and Type
    Method
    Description
    getTool(Tool tool)
    Gets a provider to the file for a Tool to be used.
    org.gradle.api.file.DirectoryProperty
    Gets the global caches to be used for this plugin.
    org.gradle.api.file.DirectoryProperty
    Gets the local caches to be used for this plugin.
    org.gradle.api.file.DirectoryProperty
    Gets the root project directory to be used for this plugin.
    org.gradle.api.file.DirectoryProperty
    Gets the working project directory to be used for this plugin.
  • Method Details

    • getTool

      Tool.Resolved getTool(Tool tool)
      Gets a provider to the file for a Tool to be used. The tool's state is managed by Gradle through the ValueSource API and will not cause caching issues.
      Parameters:
      tool - The tool to get
      Returns:
      A provider for the tool file
    • globalCaches

      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 not Project or Settings)
    • localCaches

      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 local caches (i.e. the target is not Project or Settings)
    • rootProjectDirectory

      org.gradle.api.file.DirectoryProperty rootProjectDirectory()

      Gets the root project directory to be used for this plugin.

      This directory is either the ProjectLayout.getProjectDirectory() of Project.getRootProject() or the BuildLayout.getRootDirectory() of the Settings. Attempting to call this when the plugin target is neither type will throw an exception.

      Returns:
      The root project directory
      Throws:
      RuntimeException - If this plugin cannot access the root project directory (i.e. the target is not Project or Settings)
    • workingProjectDirectory

      org.gradle.api.file.DirectoryProperty workingProjectDirectory()

      Gets the working project directory to be used for this plugin.

      This directory is either the ProjectLayout.getProjectDirectory() of the Project or the BuildLayout.getRootDirectory() of the Settings. Attempting to call this when the plugin target is neither type will throw an exception.

      Returns:
      The working project directory
      Throws:
      RuntimeException - If this plugin cannot access the working project directory (i.e. the target is not Project or Settings)