run_add_exec()
def run_add_exec(name, command, help, args, env, deps, inputs, type, working_directory, platforms, log_level, redirect_stdout, timeout, expect)
Adds a command to the run dependency graph
Args
name
- The name of the rule.command
- The command to execute.help
- The help message for the rule.args
- The arguments to pass to the command.env
- key value pairs of environment variablesdeps
- The rule dependencies that must be run before this commandinputs
- List of globs to specify the inputs. If the inputs are unchanged, the command will not run.type
- The exec type (“Run”| “Setup” | “Optional”)working_directory
- The directory to run the command (default is workspace root).platforms
- Platforms to run on (default is all).log_level
- The log level to use None|Appredirect_stdout
- The file to redirect stdout to (prefer to parse the log file).timeout
- Number of seconds to run before sending a kill signal.expect
- The expected result of the command Success|Failure|Any. (default is Success)
run_add_exec_setup()
def run_add_exec_setup(name, command, help, args, env, deps, working_directory, platforms, log_level, redirect_stdout, timeout, expect)
Adds a command as a setup rule. It will run only once and all run rules will depend on it.
All setup rules can be executed with:
spaces run //:setup
Args
name
- The name of the rule.command
- The command to execute.help
- The help message for the rule.args
- The arguments to pass to the commandenv
- key value pairs of environment variablesdeps
- The rule dependenciesworking_directory
- The directory to run the command (default is workspace root).platforms
- Platforms to run on (default is all).log_level
- The log level to use None|Appredirect_stdout
- The file to redirect stdout to (prefer to parse the log file).timeout
- Number of seconds to run before sending a kill signal.expect
- The expected result of the command Success|Failure|Any. (default is Success)
run_add_exec_test()
def run_add_exec_test(name, command, help, args, env, deps, inputs, working_directory, platforms, log_level, redirect_stdout, timeout, expect)
Adds a command as a test rule.
All test rules can be executed with:
spaces run //:test
Args
name
- The name of the rule.command
- The command to execute.help
- The help message for the rule.args
- The arguments to pass to the commandenv
- key value pairs of environment variablesdeps
- The rule dependenciesinputs
- List of globs to specify the inputs. If the inputs are unchanged, the command will not run.working_directory
- The directory to run the command (default is workspace root).platforms
- Platforms to run on (default is all).log_level
- The log level to use None|Appredirect_stdout
- The file to redirect stdout to (prefer to parse the log file).timeout
- Number of seconds to run before sending a kill signal.expect
- The expected result of the command Success|Failure|Any. (default is Success)
run_add_kill_exec()
def run_add_kill_exec(name, target, signal, help, expect, deps, type, platforms)
Adds a target that will send a signal to another target.
Args
name
- The name of the rule.target
- The name of the rule to kill.signal
- The signal to send to the target.help
- The help message for the rule.expect
- The expected result of the kill. (default is Success)deps
- Run rule dependencies.type
- The exec type (“Run”| “Setup” | “Optional”)platforms
- Platforms to run on (default is all).
run_add_target()
def run_add_target(name, deps, help, type, platforms)
Adds a target to the workspace.
This rule can be used to consolidate dependencies into a single target.
Args
name
- The name of the rule.deps
- List of dependencies for the target.help
- The help message for the rule.type
- The exec type (“Run”| “Setup” | “Optional”)platforms
- List of platforms to build the target for (default is all).
run_add_to_all()
def run_add_to_all(name, deps)
Creates a target rule called name with deps and part of :all
.
Targets will run with spaces run
.
Args
name
- The name of the rule.deps
- List of dependencies to run withspaces run
run_expect_any()
def run_expect_any()
Expect the command to succeed or fail.
spaces
exits successfully if the command succeeds or fails.
Returns
str: “Any”
run_expect_failure()
def run_expect_failure()
Expect the command to fail.
If the command fails and is expected to fail, spaces exits successfully.
Returns
str: “Failure”
run_expect_success()
def run_expect_success()
Expect the command to succeed
Returns
str: “Success”
run_inputs_always()
def run_inputs_always()
Assign inputs
to None
to run the command every time.
Returns
None
run_inputs_once()
def run_inputs_once()
Assign inputs
to []
to run the command once.
Returns
list: []
run_log_level_app()
def run_log_level_app()
Print the output of the run rule while running spaces
Returns
str: “App”
run_signal_abort()
def run_signal_abort()
Gets the Abort signal
run_signal_alarm()
def run_signal_alarm()
Gets the Alarm signal
run_signal_hup()
def run_signal_hup()
Gets the Hangup signal
run_signal_int()
def run_signal_int()
Gets the Interrupt signal
run_signal_kill()
def run_signal_kill()
Gets the Kill signal
run_signal_quit()
def run_signal_quit()
Gets the Quit signal
run_signal_terminate()
def run_signal_terminate()
Gets the Terminate signal
run_signal_user1()
def run_signal_user1()
Gets the User1 signal
run_signal_user2()
def run_signal_user2()
Gets the User2 signal
run_type_all()
def run_type_all()
Assign type
to Run
to run the command with spaces run
.
The rules marked as Run
are part of the //:all
target.
spaces run //:all
Returns
str: “Run”