anki/ftl/BUILD.bazel
Damien Elmes bef1fabd74 catch references to missing terms in ftl check
https://github.com/ankitects/anki/pull/889

- We can't use compare_locales's getChecker(), as it seems to
be focused on checking translations rather than the original
templates.
- Also fix return code not being passed on in check_files()
- Temporarily pin pip-tools, as its output format has changed
2021-01-04 13:19:17 +10:00

62 lines
1.2 KiB
Python

load("@py_deps//:requirements.bzl", "requirement")
fluent_syntax = [
requirement("fluent.syntax"),
requirement("compare-locales"),
# undeclared runtime dependency
requirement("six"),
]
filegroup(
name = "ftl",
srcs = [
"@rslib_ftl//:files",
"@extra_ftl//:files",
] + glob(["**/*.ftl"]),
visibility = ["//rslib:__subpackages__"],
)
py_binary(
name = "format",
srcs = ["format.py"],
deps = fluent_syntax,
)
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"],
deps = fluent_syntax,
)
py_binary(
name = "sync",
srcs = ["sync.py"],
tags = ["manual"],
)
py_binary(
name = "extract-strings",
srcs = ["extract-strings.py"],
tags = ["manual"],
deps = fluent_syntax,
)
py_binary(
name = "transform-string",
srcs = ["transform-string.py"],
tags = ["manual"],
deps = fluent_syntax,
)
# export this file as a way of locating the top level folder in $(location ...)
exports_files(
["BUILD.bazel"],
visibility = ["//rslib:__subpackages__"],
)