run_add_archive()
def run_add_archive(name, archive_name, deps, version, source_directory, suffix, includes, excludes, platform)Adds an archive target to the workspace.
This rule can be used to consolidate dependencies into a single target.
Args
name-strThe name of the rule.archive_name-deps-[str]List of dependencies to run withspaces runversion-strThe version of the archive.source_directory-strThe directory containing the source files to archive.suffix-includes-[str]List of globs to include in the archive.excludes-[str]List of globs to exclude from the archive.platform-strThe platform to build the target for (default is all).
Returns
A tuple containing (
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-strThe name of the rule.command-strThe command to execute.help-strThe help message for the rule.args-[str]The arguments to pass to the command.env-dictkey value pairs of environment variablesdeps-[str]The rule dependencies that must be run before this commandinputs-[str]List of globs to specify the inputs. If the inputs are unchanged, the command will not run.type-strThe exec type (Run|Setup|Optional (default)|PreCommit|Clean|Test)working_directory-strThe directory to run the command (default is workspace root).platforms-[str]Platforms to run on (default is all).log_level-strThe log level to use None|App|Passthroughredirect_stdout-strThe file to redirect stdout to (prefer to parse the log file).timeout-floatNumber of seconds to run before sending a kill signal.expect-strThe expected result of the command Success|Failure|Any. (default is Success)
run_add_exec_clean()
def run_add_exec_clean(name, command, help, args, env, deps, inputs, working_directory, platforms, log_level, redirect_stdout, timeout, expect)Adds a command as a clean rule.
All test rules can be executed with:
spaces run //:cleanArgs
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_exec_precommit()
def run_add_exec_precommit(name, command, help, args, env, deps, inputs, working_directory, platforms, log_level, redirect_stdout, timeout, expect)Adds a command as a pre-commit rule.
All pre-commit rules can be executed with:
spaces run //:pre-commitArgs
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_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 //:setupArgs
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 //:testArgs
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-strThe name of the rule.target-strThe name of the rule to kill.signal-strThe signal to send to the target.help-strThe help message for the rule.expect-strThe expected result of the kill. (default is Success)deps-[str]Run rule dependencies.type-strSee run_add_exec()platforms-[str]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-strThe name of the rule.deps-[str]List of dependencies for the target.help-strThe help message for the rule.type-strSee run_add_exec()platforms-[str]List of platforms to build the target for (default is all).
run_add_target_precommit()
def run_add_target_precommit(name, deps, help, platforms)Adds a target to the workspace that //:pre-commit will depend on.
This rule can be used to consolidate PreCommit dependencies into a single target.
Args
name-strThe name of the rule.deps-[str]List of dependencies for the target.help-strThe help message for the rule.platforms-[str]List of platforms to build the target for (default is all).
run_add_target_test()
def run_add_target_test(name, deps, help, platforms)Adds a target to the workspace that //:test will depend on.
This rule can be used to consolidate test dependencies into a single target.
Args
name-strThe name of the rule.deps-[str]List of dependencies for the target.help-strThe help message for the rule.platforms-[str]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 or spaces run //:all.
Args
name-strThe name of the rule.deps-[str]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_log_level_passthrough()
def run_log_level_passthrough()Print the output of the run rule while running spaces with no additional markings
Returns
str: “Passthrough”
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 //:allReturns
str: “Run”
run_type_precommit()
def run_type_precommit()The rules added as PreCommit are part of the //:pre-commit target.
spaces run //:pre-commitReturns
str: “PreCommit”
run_type_setup()
def run_type_setup()The rules added as Setup are part of the //:setup target.
spaces run //:setupReturns
str: “Setup”
run_type_test()
def run_type_test()The rules added as Test are part of the //:test target.
spaces run //:testReturns
str: “Test”