implementation function when you create a module extension.
Members
- download
- download_and_extract
- execute
- extension_metadata
- extract
- facts
- file
- getenv
- is_dev_dependency
- modules
- os
- path
- read
- report_progress
- root_module_has_non_dev_dependency
- watch
- which
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
extension_metadata
Parameters
extract
Parameters
facts
facts
parameter of extension_metadata or else
{}.
This is useful for extensions that want to preserve universally true facts such as the
hashes of artifacts in an immutable repository.
Note that the returned value may have been created by a different version of the
extension, which may have used a different schema.
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.
is_dev_dependency
devDependency = True.
Parameters
modules
os
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
report_progress
Parameters
root_module_has_non_dev_dependency
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
which
path of the corresponding program or None if there is no such program in the path.
Parameters
May return
None.