Class WranglerTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
dev.gmitch215.bytebox.gradle.WranglerTask
All Implemented Interfaces:
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>

@DisableCachingByDefault(because="runs an external command whose result is not a file") public abstract class WranglerTask extends org.gradle.api.DefaultTask
Runs the Wrangler CLI in the generated Worker project.

The account-touching commands work only when Wrangler is logged in, so each task says whether it needs one. Nothing local does: compiling, packing, measuring and workerDev against the local simulator all run with no credentials at all, which is the common case and stays silent.

Since:
1.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    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
    WranglerTask(org.gradle.process.ExecOperations exec)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<String>
    Returns extra arguments from the command line.
    abstract org.gradle.api.provider.ListProperty<String>
    Returns the Wrangler subcommand and its fixed arguments.
    abstract org.gradle.api.provider.Property<Boolean>
    Returns whether a write was confirmed.
    abstract org.gradle.api.provider.Property<Boolean>
    Returns whether this command changes or destroys something.
    abstract org.gradle.api.file.DirectoryProperty
    Returns the generated Worker project, which is the working directory.
    abstract org.gradle.api.provider.Property<Boolean>
    Returns whether this command needs a logged-in Wrangler.
    abstract org.gradle.api.provider.Property<String>
    Returns the pinned runner, or empty to search.
    void
    run()
    Runs the command.
    void
    Extra arguments, split on spaces.
    void
    setConfirmedOption(boolean confirmed)
    Confirms a command that writes.

    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, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • WranglerTask

      @Inject public WranglerTask(org.gradle.process.ExecOperations exec)
      Parameters:
      exec - Gradle's process runner
  • Method Details

    • getCommand

      @Internal public abstract org.gradle.api.provider.ListProperty<String> getCommand()
      Returns the Wrangler subcommand and its fixed arguments.
      Returns:
      the Wrangler subcommand and its fixed arguments
    • getProjectDirectory

      @Internal public abstract org.gradle.api.file.DirectoryProperty getProjectDirectory()
      Returns the generated Worker project, which is the working directory.
      Returns:
      the generated Worker project, which is the working directory
    • getRunner

      @Internal public abstract org.gradle.api.provider.Property<String> getRunner()
      Returns the pinned runner, or empty to search.
      Returns:
      the pinned runner, or empty to search
    • getRequiresAccount

      @Internal public abstract org.gradle.api.provider.Property<Boolean> getRequiresAccount()
      Returns whether this command needs a logged-in Wrangler.
      Returns:
      whether this command needs a logged-in Wrangler
    • getDestructive

      @Internal public abstract org.gradle.api.provider.Property<Boolean> getDestructive()
      Returns whether this command changes or destroys something.
      Returns:
      whether this command changes or destroys something
    • getArgs

      @Internal public abstract org.gradle.api.provider.Property<String> getArgs()
      Returns extra arguments from the command line.
      Returns:
      extra arguments from the command line
    • setArgsOption

      public void setArgsOption(String args)
      Extra arguments, split on spaces.
      Parameters:
      args - the arguments
    • getConfirmed

      @Internal public abstract org.gradle.api.provider.Property<Boolean> getConfirmed()
      Returns whether a write was confirmed.
      Returns:
      whether a write was confirmed
    • setConfirmedOption

      public void setConfirmedOption(boolean confirmed)
      Confirms a command that writes.
      Parameters:
      confirmed - whether to go ahead
    • run

      public void run()
      Runs the command.