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>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.IConventionAware,org.gradle.api.internal.TaskInternal,Named,ExtensionAware,Task,BaseExecSpec,JavaExecSpec,JavaForkOptions,ProcessForkOptions,Configurable<Task>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final 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 voidDeprecated.protected final voidargOnlyIf(String arg, Spec<? super ToolExecBase<?>> onlyIf) Deprecated.protected final voidAdds each file to the arguments preceded by the given argument.protected final voidargs(String arg, FileSystemLocationProperty<? extends FileSystemLocation> fileProvider) Adds the given argument followed by the given file location to the arguments.protected final voidargs(String arg, FileSystemLocationProperty<? extends FileSystemLocation> fileProvider, boolean locationOnly) Adds the given argument followed by the given file location to the arguments.protected final voidargs(String arg, @UnknownNullability Provider<?> provider) Adds the given argument followed by the given object (may be a file location) to the arguments.protected final voidvoidexec()Additional arguments to use when invoking the tool.protected final PThe enhanced problems instance to use for this task.protected abstract ProjectLayoutThe project layout provided by Gradle services.Methods 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, getConvention, 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.process.JavaExecSpec
setMainMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Field Details
-
defaultToolDir
The default tool directory (usage is not required).
-
-
Constructor Details
-
Method Details
-
getAdditionalArgs
Additional arguments to use when invoking the tool. Use in configuration instead ofargs(java.lang.String, java.lang.Iterable<? extends java.io.File>).- Returns:
- The list property for the additional arguments
-
getProjectLayout
The project layout provided by Gradle services.- Returns:
- The project layout
- See Also:
-
getProblems
-
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 classJavaExec- Implementation Note:
- Not invoking this method from an overriding method will result in the tool never being executed and
addArguments()never being run.
-
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, FileSystemLocationProperty<? extends 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
protected final void args(String arg, FileSystemLocationProperty<? extends FileSystemLocation> fileProvider, boolean locationOnly) 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
-
args
-
argOnlyIf
@Deprecated @ScheduledForRemoval protected final void argOnlyIf(String arg, Provider<Boolean> onlyIf) Deprecated.Adds the given argument if and only if the given boolean property is present and true.- Parameters:
arg- The argument to addonlyIf- The provider to test
-
argOnlyIf
@Deprecated @ScheduledForRemoval protected final void argOnlyIf(String arg, Spec<? super ToolExecBase<?>> onlyIf) Deprecated.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
-
args(String, Provider).