Class ToolExecBase<P extends EnhancedProblems>

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.JavaExec
net.minecraftforge.gradleutils.shared.ToolExecBase<P>
Type Parameters:
P - The type of enhanced problems, used for common problems reporting with illegal task arguments
All Implemented Interfaces:
Comparable<Task>, EnhancedPluginAdditions, EnhancedTask<P>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, Named, ExtensionAware, Task, BaseExecSpec, JavaExecSpec, JavaForkOptions, ProcessForkOptions, Configurable<Task>

public abstract class ToolExecBase<P extends EnhancedProblems> extends JavaExec implements EnhancedTask<P>
This tool execution task is a template on top of JavaExec to make executing tools much easier and more consistent between plugins.
See Also:
Implementation Requirements:
Implementing plugins should make a shared subclass named ToolExec which all other tool executing tasks should extend from.
  • Field Details

    • defaultToolDir

      protected final DirectoryProperty defaultToolDir
      The default tool directory (usage is not required).
  • Constructor Details

    • ToolExecBase

      protected ToolExecBase(Tool tool)
      Creates a new task instance using the given types and tool information.
      Parameters:
      tool - The tool to use for this task
      Implementation Requirements:
      The implementing subclass must make their constructor public, annotated with Inject, and have only a single parameter for Tool, passing in static plugin and problems types to this base constructor. The types must also be manually specified in the class declaration when overriding this class. The best practice is to make a single ToolExec class for the implementing plugin to use, which other tasks can extend off of.
  • Method Details