| # Copyright 2026 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| module( |
| name = "xx__replace_me__xx", |
| version = "0.0.1", |
| ) |
| |
| bazel_dep(name = "fuchsia_infra") |
| local_path_override( |
| module_name = "fuchsia_infra", |
| path = "third_party/fuchsia-infra-bazel-rules", |
| ) |
| |
| # BCR dependencies. |
| bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest") |
| bazel_dep(name = "platforms", version = "1.0.0") # Used by @fuchsia_clang transitively. |
| bazel_dep(name = "rules_cc", version = "0.2.14") |
| |
| # Replace the fake (stub) `@fuchsia_sdk` in googletest with our real `@fuchsia_sdk` instance. |
| fake_fuchsia_sdk_extension = use_extension("@com_google_googletest//:fake_fuchsia_sdk.bzl", "fuchsia_sdk") |
| |
| override_repo(fake_fuchsia_sdk_extension, "fuchsia_sdk") |
| |
| # Setup CIPD. |
| cipd_tool_repository = use_repo_rule("@fuchsia_infra//cipd:defs.bzl", "cipd_tool_repository") |
| |
| cipd_tool_repository(name = "cipd_tool") |
| |
| cipd_ext = use_extension("@fuchsia_infra//cipd:defs.bzl", "cipd_ext") |
| |
| # Fuchsia dependencies. |
| cipd_ext.repository( |
| name = "rules_fuchsia", |
| ensure_file = "//manifests:rules_fuchsia.ensure", |
| ) |
| use_repo(cipd_ext, "rules_fuchsia") |
| |
| cipd_ext.repository( |
| name = "fuchsia_sdk", |
| ensure_file = "//manifests:bazel_sdk.ensure", |
| ) |
| use_repo(cipd_ext, "fuchsia_sdk") |
| |
| fuchsia_clang_ext = use_extension("@fuchsia_infra//:extensions.bzl", "fuchsia_clang_ext") |
| fuchsia_clang_ext.cipd_ensure( |
| ensure_file = "//manifests:clang.ensure", |
| ) |
| use_repo(fuchsia_clang_ext, "fuchsia_clang") |
| |
| fuchsia_products_repository = use_repo_rule("@rules_fuchsia//fuchsia:products.bzl", "fuchsia_products_repository") |
| |
| fuchsia_products_repository( |
| name = "fuchsia_products", |
| cipd_bin = "@cipd_tool//:cipd", |
| ensure_file = "//manifests:product_bundles.ensure", |
| ) |
| |
| # Register toolchains. |
| # Fuchsia SDK toolchain. |
| fuchsia_toolchain_repo = use_repo_rule("@rules_fuchsia//fuchsia/workspace:register_fuchsia_sdk_toolchain.bzl", "fuchsia_toolchain_decl") |
| |
| fuchsia_toolchain_repo( |
| name = "fuchsia_sdk_toolchain", |
| toolchain_path = "@fuchsia_sdk//:fuchsia_toolchain_info", |
| ) |
| |
| register_toolchains("@fuchsia_sdk_toolchain//:all") |
| |
| # Target cpp toolchain. |
| register_toolchains("@fuchsia_clang//:all") |
| |
| # Host cpp toolchain. |
| fuchsia_clang_host_toolchain_repo = use_repo_rule("@fuchsia_infra//infra:host_toolchains.bzl", "fuchsia_clang_host_toolchain_repo") |
| |
| fuchsia_clang_host_toolchain_repo(name = "host_clang_toolchain") |
| |
| register_toolchains("@host_clang_toolchain//:all") |
| |
| # Shac |
| use_repo(cipd_ext, "shac") |