Package co.elastic.gradle.sandbox
Class SandboxExecBaseTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
co.elastic.gradle.sandbox.SandboxExecBaseTask
- All Implemented Interfaces:
co.elastic.gradle.utils.XunitCreatorTask,Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
- Direct Known Subclasses:
SandboxExecTask
@CacheableTask
public abstract class SandboxExecBaseTask
extends org.gradle.api.DefaultTask
implements co.elastic.gradle.utils.XunitCreatorTask
Run a command in a sandbox with caching enabled
NOTE: This should be used with deterministic commands only!
e.x.
tasks.register<SandboxExecTask>("example") {
reads("src/foo.txt")
writesFile(file("out.txt"))
writesDir(file("$buildDir/results"))
commandLine("example", "src/foo.txt")
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Pathprotected final Pathprotected org.gradle.api.file.FileCollectionprotected final Fileprotected intprotected org.gradle.api.file.FileCollectionprotected final Pathprotected final Pathprotected PathFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.gradle.process.ExecResultdoExec()voidenvironment(String key, String value) voidenvironment(Map<String, String> env) protected abstract org.gradle.process.ExecOperationsprotected abstract org.gradle.api.internal.file.FileOperationsprotected abstract org.gradle.api.internal.provider.PropertyFactoryprotected abstract org.gradle.api.provider.ProviderFactoryorg.gradle.api.file.FileCollectiongetReads()org.gradle.api.provider.Provider<Collection<File>>voidmaxTries(int maxTries) voidvoidsetCommandLine(List<String> commandLine) voidsetWorkingDir(String relativePath) voidvoidMethods 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 java.lang.Comparable
compareToMethods inherited from interface org.gradle.api.plugins.ExtensionAware
getExtensionsMethods inherited from interface org.gradle.api.Task
configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, doNotTrackState, finalizedBy, getActions, getAnt, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getFinalizedBy, getGroup, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getPath, getProject, getShouldRunAfter, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, notCompatibleWithConfigurationCache, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
-
Field Details
-
commandLine
-
environment
-
rootProjectPath
-
currentProjectPath
-
inputFiles
protected org.gradle.api.file.FileCollection inputFiles -
nonInputFiles
protected org.gradle.api.file.FileCollection nonInputFiles -
outputFiles
-
outputDirs
-
maxTries
protected int maxTries -
marker
-
baseDir
-
sandbox
-
workingDirectory
-
-
Constructor Details
-
SandboxExecBaseTask
public SandboxExecBaseTask()
-
-
Method Details
-
getPropertyFactory
@Inject protected abstract org.gradle.api.internal.provider.PropertyFactory getPropertyFactory() -
getExecOperations
@Inject protected abstract org.gradle.process.ExecOperations getExecOperations() -
getFileOperations
@Inject protected abstract org.gradle.api.internal.file.FileOperations getFileOperations() -
getProviderFactory
@Inject protected abstract org.gradle.api.provider.ProviderFactory getProviderFactory() -
setCommandLine
-
setWorkingDir
-
getWorkingDir
-
getCommandLine
-
getEnvironment
-
environment
-
environment
-
reads
-
getReads
@InputFiles @PathSensitive(RELATIVE) public org.gradle.api.file.FileCollection getReads() -
writes
-
maxTries
public void maxTries(int maxTries) -
getOutputFiles
-
getXunitFiles
- Specified by:
getXunitFilesin interfaceco.elastic.gradle.utils.XunitCreatorTask
-
getOutputDirs
-
taskAction
- Throws:
IOException
-
doExec
protected abstract org.gradle.process.ExecResult doExec()
-