@Generated(value="jsii-pacmak/1.47.0 (build 86d2c33)", date="2021-12-20T00:39:28.442Z") @Stability(value=Experimental) public class Task extends software.amazon.jsii.JsiiObject
Modeled as a series of shell commands and subtasks.
| Modifier and Type | Class and Description |
|---|---|
static class |
Task.Builder
(experimental) A fluent builder for
Task. |
| Modifier | Constructor and Description |
|---|---|
protected |
Task(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Task(software.amazon.jsii.JsiiObjectRef objRef) |
|
Task(String name) |
|
Task(String name,
TaskOptions props) |
| Modifier and Type | Method and Description |
|---|---|
void |
builtin(String name)
(experimental) Execute a builtin task.
|
void |
env(String name,
String value)
(experimental) Adds an environment variable to this task.
|
void |
exec(String command)
(experimental) Executes a shell command.
|
void |
exec(String command,
TaskStepOptions options)
(experimental) Executes a shell command.
|
String |
getCondition()
(experimental) A command to execute which determines if the task should be skipped.
|
String |
getDescription()
(experimental) Returns the description of this task.
|
String |
getName()
(experimental) Task name.
|
List<TaskStep> |
getSteps()
(experimental) Returns an immutable copy of all the step specifications of the task.
|
void |
lock()
(experimental) Forbid additional changes to this task.
|
void |
prepend(String shell)
Deprecated.
use `prependExec()`
|
void |
prepend(String shell,
TaskStepOptions options)
Deprecated.
use `prependExec()`
|
void |
prependExec(String shell)
(experimental) Adds a command at the beginning of the task.
|
void |
prependExec(String shell,
TaskStepOptions options)
(experimental) Adds a command at the beginning of the task.
|
void |
prependSay(String message)
(experimental) Says something at the beginning of the task.
|
void |
prependSay(String message,
TaskStepOptions options)
(experimental) Says something at the beginning of the task.
|
void |
prependSpawn(Task subtask)
(experimental) Adds a spawn instruction at the beginning of the task.
|
void |
prependSpawn(Task subtask,
TaskStepOptions options)
(experimental) Adds a spawn instruction at the beginning of the task.
|
void |
reset()
(experimental) Reset the task so it no longer has any commands.
|
void |
reset(String command)
(experimental) Reset the task so it no longer has any commands.
|
void |
reset(String command,
TaskStepOptions options)
(experimental) Reset the task so it no longer has any commands.
|
void |
say(String message)
(experimental) Say something.
|
void |
say(String message,
TaskStepOptions options)
(experimental) Say something.
|
void |
setDescription(String value)
(experimental) Returns the description of this task.
|
void |
spawn(Task subtask)
(experimental) Spawns a sub-task.
|
void |
spawn(Task subtask,
TaskStepOptions options)
(experimental) Spawns a sub-task.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Task(software.amazon.jsii.JsiiObjectRef objRef)
protected Task(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Task(@NotNull
String name,
@Nullable
TaskOptions props)
name - This parameter is required.props - @Stability(value=Experimental)
public Task(@NotNull
String name)
name - This parameter is required.@Stability(value=Experimental)
public void builtin(@NotNull
String name)
Builtin tasks are programs bundled as part of projen itself and used as helpers for various components.
In the future we should support built-in tasks from external modules.
name - The name of the builtin task to execute (e.g. `release/resolve-version`). This parameter is required.@Stability(value=Experimental)
public void env(@NotNull
String name,
@NotNull
String value)
name - The name of the variable. This parameter is required.value - The value. This parameter is required.@Stability(value=Experimental)
public void exec(@NotNull
String command,
@Nullable
TaskStepOptions options)
command - Shell command. This parameter is required.options - Options.@Stability(value=Experimental)
public void exec(@NotNull
String command)
command - Shell command. This parameter is required.@Stability(value=Experimental) public void lock()
@Stability(value=Deprecated) @Deprecated public void prepend(@NotNull String shell, @Nullable TaskStepOptions options)
shell - The command to add. This parameter is required.options - @Stability(value=Deprecated) @Deprecated public void prepend(@NotNull String shell)
shell - The command to add. This parameter is required.@Stability(value=Experimental)
public void prependExec(@NotNull
String shell,
@Nullable
TaskStepOptions options)
shell - The command to add. This parameter is required.options - @Stability(value=Experimental)
public void prependExec(@NotNull
String shell)
shell - The command to add. This parameter is required.@Stability(value=Experimental)
public void prependSay(@NotNull
String message,
@Nullable
TaskStepOptions options)
message - Your message. This parameter is required.options - @Stability(value=Experimental)
public void prependSay(@NotNull
String message)
message - Your message. This parameter is required.@Stability(value=Experimental)
public void prependSpawn(@NotNull
Task subtask,
@Nullable
TaskStepOptions options)
subtask - The subtask to execute. This parameter is required.options - @Stability(value=Experimental)
public void prependSpawn(@NotNull
Task subtask)
subtask - The subtask to execute. This parameter is required.@Stability(value=Experimental)
public void reset(@Nullable
String command,
@Nullable
TaskStepOptions options)
command - the first command to add to the task after it was cleared.options - @Stability(value=Experimental)
public void reset(@Nullable
String command)
command - the first command to add to the task after it was cleared.@Stability(value=Experimental) public void reset()
@Stability(value=Experimental)
public void say(@NotNull
String message,
@Nullable
TaskStepOptions options)
message - Your message. This parameter is required.options - Options.@Stability(value=Experimental)
public void say(@NotNull
String message)
message - Your message. This parameter is required.@Stability(value=Experimental)
public void spawn(@NotNull
Task subtask,
@Nullable
TaskStepOptions options)
subtask - The subtask to execute. This parameter is required.options - @Stability(value=Experimental)
public void spawn(@NotNull
Task subtask)
subtask - The subtask to execute. This parameter is required.@Stability(value=Experimental) @NotNull public String getName()
@Stability(value=Experimental) @NotNull public List<TaskStep> getSteps()
@Stability(value=Experimental) @Nullable public String getCondition()
If it returns a zero exit code, the task will not be executed.
@Stability(value=Experimental) @Nullable public String getDescription()
Sets the description of this task.
@Stability(value=Experimental)
public void setDescription(@Nullable
String value)
Sets the description of this task.
Copyright © 2021. All rights reserved.