Public API

Macros and Functions

is_darwin_os

Returns true if the host operating system is Darwin

Example usage (generated)

load("@aspect_bazel_lib//lib:repo_utils.bzl", "is_darwin_os")

is_darwin_os(
    rctx = None,
)

rctx


is_linux_os

Returns true if the host operating system is Linux

Example usage (generated)

load("@aspect_bazel_lib//lib:repo_utils.bzl", "is_linux_os")

is_linux_os(
    rctx = None,
)

rctx


is_windows_os

Returns true if the host operating system is Windows

Example usage (generated)

load("@aspect_bazel_lib//lib:repo_utils.bzl", "is_windows_os")

is_windows_os(
    rctx = None,
)

rctx


patch

Implementation of patching an already extracted repository.

This rule is intended to be used in the implementation function of a repository rule. If the parameters patches, patch_tool, patch_args, patch_cmds and patch_cmds_win are not specified then they are taken from ctx.attr.

Example usage (generated)

load("@aspect_bazel_lib//lib:repo_utils.bzl", "patch")

patch(
    # The repository context of the repository rule calling this utility
    ctx = None,
)

ctx

The repository context of the repository rule calling this utility function.

patches

The patch files to apply. List of strings, Labels, or paths.

patch_cmds

Bash commands to run for patching, passed one at a time to bash -c. List of strings

patch_cmds_win

Powershell commands to run for patching, passed one at a time to powershell /c. List of strings. If the boolean value of this parameter is false, patch_cmds will be used and this parameter will be ignored.

patch_tool

Path of the patch tool to execute for applying patches. String.

patch_args

Arguments to pass to the patch tool. List of strings.

auth

An optional dict specifying authentication information for some of the URLs.

patch_directory

Directory to apply the patches in