mirror of
https://github.com/ankitects/anki.git
synced 2025-12-21 19:02:57 -05:00
84 lines
1.6 KiB
Text
84 lines
1.6 KiB
Text
load("@rules_python//python:defs.bzl", "py_binary")
|
|
load("//ts:prettier.bzl", "prettier_test")
|
|
load("//ts:eslint.bzl", "eslint_test")
|
|
load("//ts:protobuf.bzl", "protobufjs_library")
|
|
load("//ts:typescript.bzl", "typescript")
|
|
load("@py_deps//:requirements.bzl", "requirement")
|
|
load("//ts:jest.bzl", "jest_test")
|
|
|
|
py_binary(
|
|
name = "genfluent",
|
|
srcs = [
|
|
"genfluent.py",
|
|
],
|
|
deps = [
|
|
requirement("black"),
|
|
requirement("stringcase"),
|
|
],
|
|
)
|
|
_i18n_generated = [
|
|
"translate.ts",
|
|
"i18n/modules.ts",
|
|
]
|
|
|
|
genrule(
|
|
name = "fluent_gen",
|
|
outs = _i18n_generated,
|
|
cmd = "$(location genfluent) $(location //rslib/i18n:strings.json) $(OUTS)",
|
|
tools = [
|
|
"genfluent",
|
|
"//rslib/i18n:strings.json",
|
|
],
|
|
)
|
|
|
|
protobufjs_library(
|
|
name = "backend_proto",
|
|
proto = "//proto:backend_proto_lib",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
_generated = [
|
|
"backend_proto.d.ts",
|
|
] + _i18n_generated
|
|
|
|
typescript(
|
|
name = "lib",
|
|
exclude = _generated,
|
|
generated = [
|
|
":backend_proto.d.ts",
|
|
":translate.ts",
|
|
":i18n/modules.ts",
|
|
],
|
|
deps = [
|
|
":backend_proto",
|
|
"@npm//@fluent/bundle",
|
|
"@npm//@types/jest",
|
|
"@npm//@types/long",
|
|
"@npm//intl-pluralrules",
|
|
"@npm//protobufjs",
|
|
"@npm//tslib",
|
|
],
|
|
)
|
|
|
|
# Tests
|
|
################
|
|
|
|
prettier_test(
|
|
srcs = glob(
|
|
["**/*.ts"],
|
|
exclude = _generated,
|
|
),
|
|
)
|
|
|
|
eslint_test(
|
|
srcs = glob(
|
|
["**/*.ts"],
|
|
exclude = _generated,
|
|
),
|
|
)
|
|
|
|
jest_test(
|
|
deps = [
|
|
":lib",
|
|
],
|
|
)
|