| # Copyright 2024 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| module( | |
| name = "ink-strokes-api", | |
| version = "0.0.1", | |
| ) | |
| git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | |
| http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
| ################################################################################# | |
| ## Toolchain setup | |
| ################################################################################# | |
| bazel_dep(name = "platforms", version = "0.0.10") | |
| bazel_dep(name = "rules_cc", version = "0.0.17") | |
| bazel_dep(name = "toolchains_llvm", version = "1.2.0") | |
| # Configure and register the LLVM toolchain for host builds. | |
| llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") | |
| llvm.toolchain( | |
| llvm_version = "16.0.0", | |
| ) | |
| use_repo(llvm, "llvm_toolchain") | |
| register_toolchains("@llvm_toolchain//:all") | |
| # Configure the Android NDK toolchain for NDK builds. Don't register that here so it's not required | |
| # for builds that don't need it. Those configs can register those in --extra_toolchains. | |
| bazel_dep(name = "rules_android_ndk", version = "0.1.3") | |
| android_ndk_repository_extension = use_extension( | |
| "@rules_android_ndk//:extension.bzl", | |
| "android_ndk_repository_extension", | |
| ) | |
| use_repo(android_ndk_repository_extension, "androidndk") | |
| ################################################################################# | |
| ## Direct dependencies | |
| ################################################################################# | |
| bazel_dep( | |
| name = "abseil-cpp", | |
| version = "20240722.0", | |
| repo_name = "com_google_absl", | |
| ) | |
| git_repository( | |
| name = "ink_stroke_modeler", | |
| commit = "11abc9c18dcc0d6074106fe14b3bd5eddd28559b", | |
| remote = "https://github.com/google/ink-stroke-modeler.git", | |
| ) | |
| git_repository( | |
| name = "libtess2", | |
| build_file = "third_party/libtess2/BUILD.bazel", | |
| commit = "fc52516467dfa124bdd967c15c7cf9faf02a34ca", | |
| remote = "https://github.com/memononen/libtess2.git", | |
| ) | |
| bazel_dep(name = "protobuf", version = "29.3") | |
| bazel_dep(name = "rules_android", version = "0.6.0") | |
| bazel_dep( | |
| name = "rules_jni", | |
| version = "0.10.1", | |
| ) | |
| SKIA_COMMIT = "515a23f3cbe1e2f54ffa6821e6da6f4891763f47" | |
| http_archive( | |
| name = "skia", | |
| integrity = "sha256-xOKsNeZapFKLRPuo8N+s3mWSUqRfWxIzWZnxnNB4kMM=", | |
| strip_prefix = "skia-" + SKIA_COMMIT, | |
| url = "https://github.com/google/skia/archive/" + SKIA_COMMIT + ".zip", | |
| ) | |
| # Skia configuration | |
| local_repository = use_repo_rule( | |
| "@bazel_tools//tools/build_defs/repo:local.bzl", | |
| "local_repository", | |
| ) | |
| local_repository( | |
| name = "skia_user_config", | |
| path = "skia_user_config", | |
| ) | |
| ################################################################################# | |
| ## Development dependencies | |
| ################################################################################# | |
| bazel_dep( | |
| name = "googletest", | |
| version = "1.15.2", | |
| dev_dependency = True, | |
| repo_name = "com_google_googletest", | |
| ) | |
| bazel_dep( | |
| name = "google_benchmark", | |
| version = "1.8.3", | |
| dev_dependency = True, | |
| repo_name = "com_google_benchmark", | |
| ) | |
| bazel_dep( | |
| name = "fuzztest", | |
| version = "20241028.0", | |
| dev_dependency = True, | |
| repo_name = "com_google_fuzztest", | |
| ) | |
| ################################################################################# | |
| ## Transitive dependencies | |
| ################################################################################# | |
| # We can remove these when Skia has a MODULE.bazel file. | |
| # See: https://g-issues.skia.org/issues/367315534 | |
| bazel_dep(name = "rules_license", version = "1.0.0") | |
| bazel_dep(name = "bazel_skylib", version = "1.7.1") | |
| # Silence warnings about duplicate Python toolchain registration by using a | |
| # newer version of rules_python. We can remove this when any of our | |
| # dependencies use a sufficiently newer rules_python. | |
| bazel_dep(name = "rules_python", version = "0.40.0") |