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

    Fields
    Modifier and Type
    Field
    Description
    protected final Path
     
    protected final List<String>
     
    protected final Path
     
    protected final Map<String,String>
     
    protected org.gradle.api.file.FileCollection
     
    protected final File
     
    protected int
     
    protected org.gradle.api.file.FileCollection
     
    protected final List<File>
     
    protected final List<File>
     
    protected final Path
     
    protected final Path
     
    protected Path
     

    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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract org.gradle.process.ExecResult
     
    void
    environment(String key, String value)
     
    void
     
     
     
    protected abstract org.gradle.process.ExecOperations
     
    protected abstract org.gradle.api.internal.file.FileOperations
     
     
     
    protected abstract org.gradle.api.internal.provider.PropertyFactory
     
    protected abstract org.gradle.api.provider.ProviderFactory
     
    org.gradle.api.file.FileCollection
     
     
    org.gradle.api.provider.Provider<Collection<File>>
     
    void
    maxTries(int maxTries)
     
    void
    reads(Object file)
     
    void
    setCommandLine(List<String> commandLine)
     
    void
    setWorkingDir(String relativePath)
     
    void
     
    void
    writes(Object file)
     

    Methods 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, usesService

    Methods 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, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Comparable

    compareTo

    Methods inherited from interface org.gradle.api.plugins.ExtensionAware

    getExtensions

    Methods 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

      protected final List<String> commandLine
    • environment

      protected final Map<String,String> environment
    • rootProjectPath

      protected final Path rootProjectPath
    • currentProjectPath

      protected final Path currentProjectPath
    • inputFiles

      protected org.gradle.api.file.FileCollection inputFiles
    • nonInputFiles

      protected org.gradle.api.file.FileCollection nonInputFiles
    • outputFiles

      protected final List<File> outputFiles
    • outputDirs

      protected final List<File> outputDirs
    • maxTries

      protected int maxTries
    • marker

      protected final File marker
    • baseDir

      protected final Path baseDir
    • sandbox

      protected final Path sandbox
    • workingDirectory

      protected Path 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

      public void setCommandLine(List<String> commandLine)
    • setWorkingDir

      public void setWorkingDir(String relativePath)
    • getWorkingDir

      @Input public String getWorkingDir()
    • getCommandLine

      @Input public List<String> getCommandLine()
    • getEnvironment

      @Input public Map<String,String> getEnvironment()
    • environment

      public void environment(String key, String value)
    • environment

      public void environment(Map<String,String> env)
    • reads

      public void reads(Object file)
    • getReads

      @InputFiles @PathSensitive(RELATIVE) public org.gradle.api.file.FileCollection getReads()
    • writes

      public void writes(Object file)
    • maxTries

      public void maxTries(int maxTries)
    • getOutputFiles

      @OutputFiles public List<File> getOutputFiles()
    • getXunitFiles

      @OutputFiles public org.gradle.api.provider.Provider<Collection<File>> getXunitFiles()
      Specified by:
      getXunitFiles in interface co.elastic.gradle.utils.XunitCreatorTask
    • getOutputDirs

      @OutputDirectories public List<File> getOutputDirs()
    • taskAction

      public void taskAction() throws IOException
      Throws:
      IOException
    • doExec

      protected abstract org.gradle.process.ExecResult doExec()