chmod()
def chmod(name, mode, path, deps, type, working_directory, expect)
Changes the mode of a file or directory.
Args
name
-str
The name of the rule.mode
- The source file or directory.path
-str
The options for the copy command.deps
-[str]
The dependencies for the copy command.type
-enum
The type of the command.working_directory
-str
The working directory for the command.expect
-enum
Success | Failure
cp()
def cp(name, source, destination, options, deps, type, inputs, working_directory, expect)
Copy a file or directory from source to destination.
Args
name
-str
The name of the rule.source
-str
The source file or directory.destination
-str
The destination file or directory.options
-[str]
The options for the copy command.deps
-[str]
The dependencies for the copy command.type
-enum
The type of the command.inputs
-[str]
The inputs for the command.working_directory
-str
The working directory for the command.expect
-enum
Success | Failure
ln()
def ln(name, source, destination, options, deps, type, working_directory, expect)
Create a link from source to destination.
Args
name
-str
The name of the rule.source
-str
The source file or directory.destination
-str
destination or target (to be created).options
-[str]
The options for the copy command.deps
-[str]
The dependencies for the copy command.type
-enum
The type of the command.working_directory
-str
The working directory for the command.expect
-enum
Success | Failure
ls()
def ls(name, path, options, deps, type, working_directory, expect)
Run ls (this can be handy for checking if something exists).
Args
name
-str
The name of the rule.path
-str
The directory to list.options
-[str]
The options for the copy command.deps
-[str]
The dependencies for the copy command.type
-enum
The type of the command.working_directory
-str
The working directory for the command.expect
-enum
Success | Failure
mkdir()
def mkdir(name, path, options, deps, type, working_directory, expect)
Create a new directory.
Args
name
- The name of the rule.path
- The source file or directory.options
- The options for the copy command.deps
- The dependencies for the copy command.type
- The type of the command.working_directory
- The working directory for the command.expect
-enum
Success | Failure
mv()
def mv(name, source, destination, options, deps, type, working_directory, expect)
Rename a file or directory from source to destination.
Args
name
- The name of the rule.source
-str
The source file or directory.destination
-str
The destination file or directory.options
-[str]
The options for the copy command.deps
-[str]
The dependencies for the copy command.type
-enum
The type of the command.working_directory
-str
The working directory for the command.expect
-enum
Success | Failure
shell()
def shell(name, script, shell, options, expect, type, working_directory, deps)
Add a run rule that executes a shell script.
Examples:
shell(
name = "echo",
script = "echo hello",
)
shell(
name = "echo",
script = "ls some_file && rm some_file",
)
Args
name
-str
name of the rulescript
-str
text of the script to runshell
-str
shell to use (default isbash
)options
-[str]
options to pass before script default is-c
expect
-enum
Success | Failuretype
-enum
Optional | All (default is Optional)working_directory
-str
working directory (default is workspace root)deps
-[str]
rule dependencies