anki/ftl/BUILD.bazel

62 lines
1.2 KiB
Python
Raw Normal View History

2020-11-22 06:30:59 +01:00
load("@py_deps//:requirements.bzl", "requirement")
2020-11-22 07:20:21 +01:00
fluent_syntax = [
requirement("fluent.syntax"),
requirement("compare-locales"),
2020-11-22 07:20:21 +01:00
# undeclared runtime dependency
requirement("six"),
]
filegroup(
name = "ftl",
srcs = [
"@rslib_ftl//:files",
"@extra_ftl//:files",
] + glob(["**/*.ftl"]),
visibility = ["//rslib:__subpackages__"],
)
2020-11-22 06:30:59 +01:00
py_binary(
name = "format",
srcs = ["format.py"],
2020-11-22 07:20:21 +01:00
deps = fluent_syntax,
2020-11-22 06:30:59 +01:00
)
py_test(
name = "format_check",
srcs = [
"format.py",
"format_check.py",
],
# so we can locate data files
args = ["$(location BUILD.bazel)"],
data = glob(["**/*.ftl"]) + ["BUILD.bazel"],
2020-11-22 07:20:21 +01:00
deps = fluent_syntax,
2020-11-22 06:30:59 +01:00
)
2020-11-22 06:37:18 +01:00
py_binary(
name = "sync",
srcs = ["sync.py"],
tags = ["manual"],
)
py_binary(
name = "extract-strings",
srcs = ["extract-strings.py"],
tags = ["manual"],
2020-11-22 07:20:21 +01:00
deps = fluent_syntax,
2020-11-22 06:37:18 +01:00
)
py_binary(
name = "transform-string",
srcs = ["transform-string.py"],
tags = ["manual"],
2020-11-22 07:20:21 +01:00
deps = fluent_syntax,
2020-11-22 06:37:18 +01:00
)
# export this file as a way of locating the top level folder in $(location ...)
exports_files(
["BUILD.bazel"],
visibility = ["//rslib:__subpackages__"],
)