anki/setup.bzl
Damien Elmes aea0a6fcc6 initial Bazel conversion
Running and testing should be working on the three platforms, but
there's still a fair bit that needs to be done:

- Wheel building + testing in a venv still needs to be implemented.
- Python requirements still need to be compiled with piptool and pinned;
need to compile on all platforms then merge
- Cargo deps in cargo/ and rslib/ need to be cleaned up, and ideally
unified into one place
- Currently using rustls to work around openssl compilation issues
on Linux, but this will break corporate proxies with custom SSL
authorities; need to conditionally use openssl or use
https://github.com/seanmonstar/reqwest/pull/1058
- Makefiles and docs still need cleaning up
- It may make sense to reparent ts/* to the top level, as we don't
nest the other modules under a specific language.
- rspy and pylib must always be updated in lock-step, so merging
rspy into pylib as a private module would simplify things.
- Merging desktop-ftl and mobile-ftl into the core ftl would make
managing and updating translations easier.
- Obsolete scripts need removing.
- And probably more.
2020-11-01 14:26:58 +10:00

65 lines
1.8 KiB
Python

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")
load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")
load("@anki//cargo:crates.bzl", "raze_fetch_remote_crates")
load(":python.bzl", "setup_local_python")
load("@rules_python//python:repositories.bzl", "py_repositories")
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
load("@build_bazel_rules_svelte//:defs.bzl", "rules_svelte_dependencies")
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load("@com_github_ali5h_rules_pip//:defs.bzl", "pip_import")
load("//pyqt5:defs.bzl", "install_pyqt5")
def setup_deps():
bazel_skylib_workspace()
rust_repositories(
edition = "2018",
# use_worker = True,
version = "1.47.0",
)
bazel_version(name = "io_bazel_rules_rust_bazel_version")
raze_fetch_remote_crates()
setup_local_python(name = "python")
native.register_toolchains("@python//:python3_toolchain")
py_repositories()
# pip_install(
# name = "py_deps",
# python_interpreter_target = "@python//:python",
# requirements = "@anki//pip:requirements.txt",
# )
pip_import(
name = "py_deps",
requirements = "@anki//pip:requirements.txt",
python_runtime = "@python//:python",
compile = True,
)
install_pyqt5(
name = "pyqt5",
python_runtime = "@python//:python",
)
node_repositories(package_json = ["//ts:package.json"])
yarn_install(
name = "npm",
package_json = "//ts:package.json",
# strict_visibility = True,
yarn_lock = "//ts:yarn.lock",
)
sass_repositories()
rules_svelte_dependencies()
protobuf_deps()