implementation function when you create a repository rule.
Members
- attr
- delete
- download
- download_and_extract
- execute
- extract
- file
- getenv
- name
- original_name
- os
- patch
- path
- read
- rename
- repo_metadata
- report_progress
- symlink
- template
- watch
- watch_tree
- which
- workspace_root
attr
delete
Parameters
download
success, a flag which is true if the download completed successfully, and if successful, a hash of the file with the fields sha256 and integrity. When sha256 or integrity is user specified, setting an explicit canonical_id is highly recommended. e.g. get_default_canonical_id
Parameters
download_and_extract
success, a flag which is true if the download completed successfully, and if successful, a hash of the file with the fields sha256 and integrity. When sha256 or integrity is user specified, setting an explicit canonical_id is highly recommended. e.g. get_default_canonical_id
Parameters
execute
timeout (in seconds, default 600 seconds). This method returns an exec_result structure containing the output of the command. The environment map can be used to override some environment variables to be passed to the process.
Parameters
extract
Parameters
file
Parameters
getenv
name as a string if exists, or default if it doesn’t.
When building incrementally, any change to the value of the variable named by name will cause this repository to be re-fetched.
Parameters
May return
None.
name
original_name instead to get the name that was originally specified as the name when this repository rule was instantiated.
original_name
name attribute when this repository rule was instantiated. This name is not necessarily unique among external repositories. Use name instead to get the canonical name of the external repository.
os
patch
Parameters
path
repository_ctx, a relative path will resolve relative to the repository directory. If it is a module_ctx, a relative path will resolve relative to a temporary working directory for this module extension. If the path is a label, it will resolve to the path of the corresponding file. Note that remote repositories and module extensions are executed during the analysis phase and thus cannot depends on a target result (the label should point to a non-generated file). If path is a path, it will return that path as is.
Parameters
read
Parameters
rename
src to dst. Parent directories are created as needed. Fails if the destination path
already exists. Both paths must be located within the repository.
Parameters
repo_metadata
Parameters
report_progress
Parameters
symlink
Parameters
template
template. Every occurrence in template of a key of substitutions will be replaced by the corresponding value. The result is written in path. An optional executable argument (default to true) can be set to turn on or off the executable bit.
Parameters
watch
path.readdir() instead.
Note that attempting to watch paths inside the repo currently being fetched, or inside the working directory of the current module extension, will result in an error. A module extension attempting to watch a path outside the current Bazel workspace will also result in an error.
Parameters
watch_tree
Parameters
which
path of the corresponding program or None if there is no such program in the path.
Parameters
May return
None.