2021-11-08 14:40:36 +00:00
|
|
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
2023-03-11 19:35:11 +00:00
|
|
|
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
2023-03-24 14:37:45 +00:00
|
|
|
load("//lib:utils.bzl", "is_bzlmod_enabled")
|
2023-10-09 20:57:34 +00:00
|
|
|
load("//lib/private:copy_common.bzl", "copy_options")
|
2023-09-29 21:42:33 +00:00
|
|
|
load("//lib/private:stamping.bzl", "stamp_build_setting")
|
2021-11-08 14:40:36 +00:00
|
|
|
|
2022-08-05 00:53:22 +00:00
|
|
|
# Ensure that users building their own rules can dep on our bzl_library targets for their stardoc
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
2021-11-17 05:30:32 +00:00
|
|
|
exports_files(
|
|
|
|
glob(["*.bzl"]),
|
|
|
|
visibility = [
|
|
|
|
"//docs:__pkg__",
|
|
|
|
"//lib:__subpackages__",
|
|
|
|
],
|
|
|
|
)
|
2021-11-08 14:40:36 +00:00
|
|
|
|
2022-07-15 05:32:39 +00:00
|
|
|
# Macro that creates targets enabling the use of `--stamp` in Starlark rules
|
|
|
|
stamp_build_setting(name = "stamp")
|
|
|
|
|
2023-03-24 14:37:45 +00:00
|
|
|
# Add a config indicating that bzlmod is enabled so that we can use select()
|
|
|
|
# to skip bzlmod-incompatible targets.
|
2023-03-11 19:35:11 +00:00
|
|
|
config_setting(
|
|
|
|
name = "bzlmod",
|
|
|
|
flag_values = {
|
|
|
|
":flag_bzlmod": "true",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
bool_flag(
|
|
|
|
name = "flag_bzlmod",
|
2023-03-24 14:37:45 +00:00
|
|
|
build_setting_default = True if is_bzlmod_enabled() else False,
|
2023-03-11 19:35:11 +00:00
|
|
|
)
|
|
|
|
|
2023-10-09 20:57:34 +00:00
|
|
|
# Users may set this flag with
|
|
|
|
bool_flag(
|
|
|
|
name = "copy_use_local_execution",
|
|
|
|
build_setting_default = True,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
|
|
|
name = "copy_use_local_execution_setting",
|
|
|
|
flag_values = {
|
|
|
|
":copy_use_local_execution": "true",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
# Used in rules which spawn actions that copy files
|
|
|
|
copy_options(
|
|
|
|
name = "copy_options",
|
|
|
|
copy_use_local_execution = select({
|
|
|
|
":copy_use_local_execution_setting": True,
|
|
|
|
"//conditions:default": False,
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
2022-04-01 03:04:35 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "jq_toolchain_type",
|
|
|
|
)
|
|
|
|
|
2022-04-20 04:45:06 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "yq_toolchain_type",
|
|
|
|
)
|
|
|
|
|
2023-01-17 01:19:13 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "copy_directory_toolchain_type",
|
|
|
|
)
|
|
|
|
|
2023-01-07 19:26:27 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "copy_to_directory_toolchain_type",
|
|
|
|
)
|
|
|
|
|
2023-01-16 18:02:17 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "coreutils_toolchain_type",
|
|
|
|
)
|
|
|
|
|
2023-05-16 23:14:50 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "expand_template_toolchain_type",
|
|
|
|
)
|
|
|
|
|
2023-10-03 20:00:58 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "tar_toolchain_type",
|
|
|
|
)
|
|
|
|
|
2021-11-08 14:40:36 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "expand_make_vars",
|
|
|
|
srcs = ["expand_make_vars.bzl"],
|
2022-08-12 02:30:45 +00:00
|
|
|
deps = [
|
2023-06-09 23:22:37 +00:00
|
|
|
":expand_template",
|
2023-05-16 23:14:50 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "expand_template",
|
|
|
|
srcs = ["expand_template.bzl"],
|
|
|
|
deps = [
|
2023-10-05 21:22:38 +00:00
|
|
|
"//lib/private:expand_template",
|
2023-09-21 01:32:05 +00:00
|
|
|
"@bazel_skylib//lib:types",
|
|
|
|
"@bazel_skylib//rules:write_file",
|
2022-08-12 02:30:45 +00:00
|
|
|
],
|
2021-11-08 14:40:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "params_file",
|
|
|
|
srcs = ["params_file.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:params_file"],
|
2021-11-08 14:40:36 +00:00
|
|
|
)
|
2021-11-09 23:13:30 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "paths",
|
|
|
|
srcs = ["paths.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:paths"],
|
2021-11-09 23:13:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "utils",
|
|
|
|
srcs = ["utils.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:utils"],
|
2021-11-09 23:13:30 +00:00
|
|
|
)
|
2021-11-10 14:42:42 +00:00
|
|
|
|
2023-10-03 20:00:58 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "tar",
|
|
|
|
srcs = ["tar.bzl"],
|
|
|
|
deps = [
|
2023-10-05 21:22:38 +00:00
|
|
|
"//lib/private:tar",
|
2023-10-03 20:00:58 +00:00
|
|
|
"@bazel_skylib//lib:types",
|
|
|
|
"@bazel_skylib//rules:write_file",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-12-09 00:47:45 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "jq",
|
|
|
|
srcs = ["jq.bzl"],
|
|
|
|
visibility = ["//visibility:public"],
|
2023-01-07 20:24:47 +00:00
|
|
|
deps = [
|
2023-10-05 21:22:38 +00:00
|
|
|
"//lib/private:jq",
|
2023-01-07 20:24:47 +00:00
|
|
|
],
|
2021-12-09 00:47:45 +00:00
|
|
|
)
|
|
|
|
|
2022-03-04 00:40:32 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "directory_path",
|
|
|
|
srcs = ["directory_path.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:directory_path"],
|
2022-03-04 00:40:32 +00:00
|
|
|
)
|
|
|
|
|
2022-03-15 00:33:52 +00:00
|
|
|
bzl_library(
|
2022-03-16 00:36:22 +00:00
|
|
|
name = "output_files",
|
|
|
|
srcs = ["output_files.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:output_files"],
|
2022-03-15 00:33:52 +00:00
|
|
|
)
|
|
|
|
|
2022-03-04 00:40:32 +00:00
|
|
|
bzl_library(
|
2022-04-01 03:04:35 +00:00
|
|
|
name = "copy_file",
|
|
|
|
srcs = ["copy_file.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:copy_file"],
|
2022-03-04 00:40:32 +00:00
|
|
|
)
|
|
|
|
|
2022-04-04 00:52:03 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "copy_directory",
|
|
|
|
srcs = ["copy_directory.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:copy_directory"],
|
2022-04-04 00:52:03 +00:00
|
|
|
)
|
|
|
|
|
2022-04-01 03:04:35 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "copy_to_directory",
|
|
|
|
srcs = ["copy_to_directory.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:copy_to_directory"],
|
2021-12-09 00:47:45 +00:00
|
|
|
)
|
2022-01-28 02:15:28 +00:00
|
|
|
|
2022-04-12 23:31:04 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "copy_to_bin",
|
|
|
|
srcs = ["copy_to_bin.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:copy_to_bin"],
|
|
|
|
)
|
|
|
|
|
|
|
|
#keep
|
|
|
|
bzl_library(
|
|
|
|
name = "diff_test",
|
|
|
|
srcs = ["diff_test.bzl"],
|
|
|
|
deps = ["//lib/private:diff_test"],
|
2022-04-12 23:31:04 +00:00
|
|
|
)
|
|
|
|
|
2022-01-28 02:15:28 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "write_source_files",
|
|
|
|
srcs = ["write_source_files.bzl"],
|
|
|
|
deps = [
|
2022-03-15 00:33:52 +00:00
|
|
|
":diff_test",
|
2022-01-28 02:15:28 +00:00
|
|
|
":utils",
|
2023-10-05 21:22:38 +00:00
|
|
|
# "//lib/private:fail_with_message_test",
|
|
|
|
"//lib/private:write_source_file",
|
2022-01-28 02:15:28 +00:00
|
|
|
],
|
|
|
|
)
|
2022-03-15 00:33:52 +00:00
|
|
|
|
2022-04-01 03:04:35 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "run_binary",
|
|
|
|
srcs = ["run_binary.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:run_binary"],
|
2022-04-01 03:04:35 +00:00
|
|
|
)
|
|
|
|
|
2022-04-12 01:08:30 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "repo_utils",
|
|
|
|
srcs = ["repo_utils.bzl"],
|
|
|
|
deps = [
|
2023-10-05 21:22:38 +00:00
|
|
|
"//lib/private:patch",
|
|
|
|
"//lib/private:repo_utils",
|
2022-04-12 01:08:30 +00:00
|
|
|
],
|
|
|
|
)
|
2022-04-20 04:45:06 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "yq",
|
|
|
|
srcs = ["yq.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:yq"],
|
2022-04-20 04:45:06 +00:00
|
|
|
)
|
2022-04-28 21:18:06 +00:00
|
|
|
|
2022-07-28 18:15:14 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "glob_match",
|
|
|
|
srcs = ["glob_match.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:glob_match"],
|
2022-07-28 18:15:14 +00:00
|
|
|
)
|
|
|
|
|
2022-04-28 21:18:06 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "host_repo",
|
|
|
|
srcs = ["host_repo.bzl"],
|
2022-09-16 18:51:48 +00:00
|
|
|
deps = [
|
2023-10-05 21:22:38 +00:00
|
|
|
"//lib/private:host_repo",
|
2022-09-16 18:51:48 +00:00
|
|
|
"@bazel_skylib//lib:versions",
|
|
|
|
],
|
2022-04-28 21:18:06 +00:00
|
|
|
)
|
2022-07-15 05:32:39 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "stamping",
|
|
|
|
srcs = ["stamping.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:stamping"],
|
2022-07-15 05:32:39 +00:00
|
|
|
)
|
2022-08-05 00:53:22 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "testing",
|
|
|
|
srcs = ["testing.bzl"],
|
2022-08-20 19:53:12 +00:00
|
|
|
deps = [
|
2023-01-09 19:06:09 +00:00
|
|
|
":jq",
|
2022-10-31 22:07:37 +00:00
|
|
|
":params_file",
|
2022-08-20 19:53:12 +00:00
|
|
|
":utils",
|
2022-10-31 22:07:37 +00:00
|
|
|
"@bazel_skylib//lib:types",
|
|
|
|
"@bazel_skylib//rules:diff_test",
|
2022-08-20 19:53:12 +00:00
|
|
|
"@bazel_skylib//rules:write_file",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "extensions",
|
|
|
|
srcs = ["extensions.bzl"],
|
|
|
|
deps = ["@aspect_bazel_lib//lib:repositories"],
|
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "repositories",
|
|
|
|
srcs = ["repositories.bzl"],
|
|
|
|
deps = [
|
2022-10-27 22:55:57 +00:00
|
|
|
":utils",
|
2023-10-05 21:22:38 +00:00
|
|
|
"//lib/private:copy_directory_toolchain",
|
|
|
|
"//lib/private:copy_to_directory_toolchain",
|
|
|
|
"//lib/private:coreutils_toolchain",
|
|
|
|
"//lib/private:expand_template_toolchain",
|
|
|
|
"//lib/private:jq_toolchain",
|
|
|
|
"//lib/private:source_toolchains_repo",
|
|
|
|
"//lib/private:tar_toolchain",
|
|
|
|
"//lib/private:yq_toolchain",
|
2022-08-20 19:53:12 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "transitions",
|
|
|
|
srcs = ["transitions.bzl"],
|
2022-12-14 19:21:08 +00:00
|
|
|
deps = [
|
|
|
|
"@bazel_skylib//lib:paths",
|
|
|
|
],
|
2022-08-20 19:53:12 +00:00
|
|
|
)
|
|
|
|
|
2022-09-14 04:58:08 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "platform_utils",
|
|
|
|
srcs = ["platform_utils.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:platform_utils"],
|
2022-09-14 04:58:08 +00:00
|
|
|
)
|
2022-11-26 01:00:02 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "base64",
|
|
|
|
srcs = ["base64.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:base64"],
|
2022-11-26 01:00:02 +00:00
|
|
|
)
|
2023-02-17 22:34:06 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "bazelrc_presets",
|
|
|
|
srcs = ["bazelrc_presets.bzl"],
|
|
|
|
deps = [":write_source_files"],
|
|
|
|
)
|
2023-05-15 19:15:55 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "strings",
|
|
|
|
srcs = ["strings.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:strings"],
|
2023-06-09 23:22:37 +00:00
|
|
|
)
|
2023-09-21 17:12:47 +00:00
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "lists",
|
|
|
|
srcs = ["lists.bzl"],
|
2023-10-05 21:22:38 +00:00
|
|
|
deps = ["//lib/private:lists"],
|
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "docs",
|
|
|
|
srcs = ["docs.bzl"],
|
|
|
|
deps = ["//lib/private:docs"],
|
2023-09-21 17:12:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
bzl_library(
|
|
|
|
name = "windows_utils",
|
|
|
|
srcs = ["windows_utils.bzl"],
|
2023-10-06 15:37:53 +00:00
|
|
|
deps = ["//lib/private:paths"],
|
2023-09-21 17:12:47 +00:00
|
|
|
)
|