Class TaskStep.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.TaskStep.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskStep.Builderargs(List<String> args)Sets the value ofTaskStepOptions.getArgs()TaskStepbuild()Builds the configured instance.TaskStep.Builderbuiltin(String builtin)Sets the value ofTaskStep.getBuiltin()TaskStep.Buildercondition(String condition)Sets the value ofTaskStepOptions.getCondition()TaskStep.Buildercwd(String cwd)Sets the value ofTaskStepOptions.getCwd()TaskStep.Builderenv(Map<String,String> env)Sets the value ofTaskStepOptions.getEnv()TaskStep.Builderexec(String exec)Sets the value ofTaskStep.getExec()TaskStep.Buildername(String name)Sets the value ofTaskStepOptions.getName()TaskStep.BuilderreceiveArgs(Boolean receiveArgs)Sets the value ofTaskStepOptions.getReceiveArgs()TaskStep.Buildersay(String say)Sets the value ofTaskStep.getSay()TaskStep.Builderspawn(String spawn)Sets the value ofTaskStep.getSpawn()
-
-
-
Method Detail
-
builtin
@Stability(Experimental) public TaskStep.Builder builtin(String builtin)
Sets the value ofTaskStep.getBuiltin()- Parameters:
builtin- The name of a built-in task to execute. Built-in tasks are node.js programs baked into the projen module and as component runtime helpers.The name is a path relative to the projen lib/ directory (without the .task.js extension). For example, if your built in builtin task is under
src/release/resolve-version.task.ts, then this would berelease/resolve-version.- Returns:
this
-
exec
@Stability(Experimental) public TaskStep.Builder exec(String exec)
Sets the value ofTaskStep.getExec()- Parameters:
exec- Shell command to execute.- Returns:
this
-
say
@Stability(Experimental) public TaskStep.Builder say(String say)
Sets the value ofTaskStep.getSay()- Parameters:
say- Print a message.- Returns:
this
-
spawn
@Stability(Experimental) public TaskStep.Builder spawn(String spawn)
Sets the value ofTaskStep.getSpawn()- Parameters:
spawn- Subtask to execute.- Returns:
this
-
args
@Stability(Experimental) public TaskStep.Builder args(List<String> args)
Sets the value ofTaskStepOptions.getArgs()- Parameters:
args- A list of fixed arguments always passed to the step. Useful to re-use existing tasks without having to re-define the whole task.\ Fixed args are always passed to the step, even ifreceiveArgsisfalseand are always passed before any args the task is called with.If the step executes a shell commands, args are passed through at the end of the
execshell command.\ The position of the args can be changed by including the marker$@inside the command string.If the step spawns a subtask, args are passed to the subtask. The subtask must define steps receiving args for this to have any effect.
If the step calls a builtin script, args are passed to the script. It is up to the script to use or discard the arguments.
- Returns:
this
-
condition
@Stability(Experimental) public TaskStep.Builder condition(String condition)
Sets the value ofTaskStepOptions.getCondition()- Parameters:
condition- A shell command which determines if the this step should be executed. If the program exits with a zero exit code, the step will be executed. A non-zero code means the step will be skipped (subsequent task steps will still be evaluated/executed).- Returns:
this
-
cwd
@Stability(Experimental) public TaskStep.Builder cwd(String cwd)
Sets the value ofTaskStepOptions.getCwd()- Parameters:
cwd- The working directory for this step.- Returns:
this
-
env
@Stability(Experimental) public TaskStep.Builder env(Map<String,String> env)
Sets the value ofTaskStepOptions.getEnv()- Parameters:
env- Defines environment variables for the execution of this step (execandbuiltinonly). Values in this map can be simple, literal values or shell expressions that will be evaluated at runtime e.g.$(echo "foo").- Returns:
this
-
name
@Stability(Experimental) public TaskStep.Builder name(String name)
Sets the value ofTaskStepOptions.getName()- Parameters:
name- Step name.- Returns:
this
-
receiveArgs
@Stability(Experimental) public TaskStep.Builder receiveArgs(Boolean receiveArgs)
Sets the value ofTaskStepOptions.getReceiveArgs()- Parameters:
receiveArgs- Should this step receive args passed to the task. Iftrue, args are passed through at the end of theexecshell command.\ The position of the args can be changed by including the marker$@inside the command string.If the step spawns a subtask, args are passed to the subtask. The subtask must define steps receiving args for this to have any effect.
- Returns:
this
-
build
@Stability(Experimental) public TaskStep build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<TaskStep>- Returns:
- a new instance of
TaskStep - Throws:
NullPointerException- if any required attribute was not provided
-
-