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<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.IConventionAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.process.BaseExecSpec,org.gradle.process.JavaExecSpec,org.gradle.process.JavaForkOptions,org.gradle.process.ProcessForkOptions,org.gradle.util.Configurable<org.gradle.api.Task>
public abstract class ToolExecBase<P extends EnhancedProblems>
extends org.gradle.api.tasks.JavaExec
This tool execution task is a template on top of
JavaExec to make executing tools much easier and more
consistent between plugins.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.gradle.api.file.DirectoryPropertyThe default tool directory (usage is not required).Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedToolExecBase(Class<P> problemsType, Tool tool) Creates a new task instance using the given types and tool information. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method should be overridden by subclasses to add arguments to this task viaJavaExec.args(java.lang.Object...).protected final voidAdds the given argument if and only if the given boolean property is present and true.protected final voidargOnlyIf(String arg, org.gradle.api.specs.Spec<? super ToolExecBase<?>> onlyIf) Adds the given argument if and only if the given spec, using this task, is satisfied.protected final voidAdds each file to the arguments preceded by the given argument.protected final voidargs(String arg, org.gradle.api.file.FileSystemLocationProperty<? extends org.gradle.api.file.FileSystemLocation> fileProvider) Adds the given argument followed by the given file location to the arguments.protected final voidAdds the given argument followed by the given object (may be a file location) to the arguments.voidexec()protected final PThe enhanced problems instance to use for this task.protected abstract org.gradle.api.file.ProjectLayoutMethods inherited from class org.gradle.api.tasks.JavaExec
args, args, bootstrapClasspath, classpath, copyTo, copyTo, debugOptions, environment, environment, executable, getAllJvmArgs, getArgs, getArgumentProviders, getBootstrapClasspath, getClasspath, getCommandLine, getDebug, getDebugOptions, getDefaultCharacterEncoding, getEnableAssertions, getEnvironment, getErrorOutput, getExecActionFactory, getExecutable, getExecutionResult, getJavaLauncher, getJavaToolchainService, getJavaVersion, getJvmArgs, getJvmArgumentProviders, getJvmArguments, getMainClass, getMainModule, getMaxHeapSize, getMinHeapSize, getModularity, getObjectFactory, getPropertyFactory, getProviderFactory, getStandardInput, getStandardOutput, getSystemProperties, getWorkingDir, isIgnoreExitValue, jvmArgs, jvmArgs, setAllJvmArgs, setAllJvmArgs, setArgs, setArgs, setArgsString, setBootstrapClasspath, setClasspath, setDebug, setDefaultCharacterEncoding, setEnableAssertions, setEnvironment, setErrorOutput, setExecutable, setExecutable, setIgnoreExitValue, setJvmArgs, setJvmArgs, setMaxHeapSize, setMinHeapSize, setStandardInput, setStandardOutput, setSystemProperties, setWorkingDir, setWorkingDir, systemProperties, systemProperty, workingDirMethods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingMethods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Field Details
-
defaultToolDir
protected final org.gradle.api.file.DirectoryProperty defaultToolDirThe default tool directory (usage is not required).
-
-
Constructor Details
-
Method Details
-
getProjectLayout
- See Also:
-
getProblems
The enhanced problems instance to use for this task.- Returns:
- The enhanced problems
-
addArguments
This method should be overridden by subclasses to add arguments to this task viaJavaExec.args(java.lang.Object...). To preserve arguments added by superclasses, this method must be invoked by overriders. -
exec
public void exec()- Overrides:
execin classorg.gradle.api.tasks.JavaExec
-
args
Adds each file to the arguments preceded by the given argument. Designed to work well with JOpt Simple.- Parameters:
arg- The flag to use for each filefiles- The files to add
-
args
protected final void args(String arg, org.gradle.api.file.FileSystemLocationProperty<? extends org.gradle.api.file.FileSystemLocation> fileProvider) Adds the given argument followed by the given file location to the arguments.- Parameters:
arg- The flag to usefileProvider- The file to add
-
args
Adds the given argument followed by the given object (may be a file location) to the arguments.- Parameters:
arg- The flag to useprovider- The object (or file) to add
-
argOnlyIf
-
argOnlyIf
protected final void argOnlyIf(String arg, org.gradle.api.specs.Spec<? super ToolExecBase<?>> onlyIf) Adds the given argument if and only if the given spec, using this task, is satisfied.- Parameters:
arg- The argument to addonlyIf- The spec to test
-