2018-12-04 15:14:08 +00:00
|
|
|
load("//lib:unittest.bzl", "TOOLCHAIN_TYPE", "unittest_toolchain")
|
|
|
|
|
2024-05-01 21:24:18 +00:00
|
|
|
package(default_applicable_licenses = ["//:license"])
|
2019-01-14 21:00:11 +00:00
|
|
|
|
2024-05-02 18:38:05 +00:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2018-12-04 15:14:08 +00:00
|
|
|
toolchain_type(
|
|
|
|
name = "toolchain_type",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
unittest_toolchain(
|
|
|
|
name = "cmd",
|
2021-10-04 16:03:48 +00:00
|
|
|
escape_chars_with = {"%": "%"},
|
2018-12-04 15:14:08 +00:00
|
|
|
failure_templ = """@echo off
|
|
|
|
echo %s
|
|
|
|
exit /b 1
|
|
|
|
""",
|
|
|
|
file_ext = ".bat",
|
|
|
|
join_on = "\necho ",
|
|
|
|
success_templ = "@exit /b 0",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2019-01-18 21:55:49 +00:00
|
|
|
toolchain(
|
|
|
|
name = "cmd_toolchain",
|
|
|
|
exec_compatible_with = [
|
2019-10-30 13:18:01 +00:00
|
|
|
"@platforms//os:windows",
|
2019-01-18 21:55:49 +00:00
|
|
|
],
|
|
|
|
toolchain = ":cmd",
|
|
|
|
toolchain_type = TOOLCHAIN_TYPE,
|
|
|
|
)
|
|
|
|
|
2018-12-04 15:14:08 +00:00
|
|
|
unittest_toolchain(
|
|
|
|
name = "bash",
|
2021-10-04 16:03:48 +00:00
|
|
|
escape_other_chars_with = "\\",
|
2018-12-04 15:14:08 +00:00
|
|
|
failure_templ = """#!/bin/sh
|
2021-10-04 16:03:48 +00:00
|
|
|
echo %s
|
2018-12-04 15:14:08 +00:00
|
|
|
exit 1
|
|
|
|
""",
|
|
|
|
file_ext = ".sh",
|
2021-10-04 16:03:48 +00:00
|
|
|
join_on = "\necho ",
|
2018-12-04 15:14:08 +00:00
|
|
|
success_templ = "#!/bin/sh\nexit 0",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
toolchain(
|
|
|
|
name = "bash_toolchain",
|
|
|
|
toolchain = ":bash",
|
|
|
|
toolchain_type = TOOLCHAIN_TYPE,
|
|
|
|
)
|
2019-01-16 22:00:03 +00:00
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "test_deps",
|
|
|
|
testonly = True,
|
|
|
|
srcs = [
|
|
|
|
"BUILD",
|
|
|
|
],
|
2024-07-15 17:57:10 +00:00
|
|
|
visibility = ["//:__subpackages__"], # Needs skylib's root BUILD file for default_applicable_licenses
|
2019-01-16 22:00:03 +00:00
|
|
|
)
|
2019-10-08 19:05:48 +00:00
|
|
|
|
|
|
|
# The files needed for distribution
|
|
|
|
filegroup(
|
|
|
|
name = "distribution",
|
|
|
|
srcs = ["BUILD"],
|
|
|
|
visibility = [
|
|
|
|
"//:__pkg__",
|
|
|
|
],
|
|
|
|
)
|