Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Action execution policy lives in tools/flutter/defs.bzl; do not set a global
# Action execution policy lives in flutter/private/rules.bzl; do not set a global
# spawn strategy here.
common --enable_bzlmod

Expand Down
17 changes: 17 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# The root package is inside the Ruleset Module, not a consumer: it asserts an
# implementation helper below, which is the only reason it reaches into
# //flutter/private.
# buildifier: disable=bzl-visibility
load("//flutter/private:android.bzl", "flutter_assets_dir")
load("//tools/ci:assertions.bzl", "expect_equal")

# The root package exists so //tools/format:buildifier_test has a label in it to
# locate the tree it should check. Nothing reads MODULE.bazel's contents through
# this export.
Expand All @@ -8,3 +15,13 @@
package(default_visibility = ["//visibility:public"])

exports_files(["MODULE.bazel"])

# Asserted rather than merely called: a silently wrong prefix is the failure
# this helper exists to prevent, and the root package is the case with no
# separator. Checked here rather than from a Consumer Module because the
# supported API deliberately does not export the helper.
expect_equal(
flutter_assets_dir(assets = ":assets"),
"assets",
"flutter_assets_dir in the root package",
)
13 changes: 6 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module(
name = "rules_flutter",
version = "0.1.0",
name = "sameri11_rules_flutter",
)

flutter = use_extension("//tools/flutter:repo.bzl", "flutter")
flutter = use_extension("//flutter/private:repo.bzl", "flutter")
use_repo(
flutter,
"flutter_embedding_debug",
Expand All @@ -22,7 +21,7 @@ bazel_dep(name = "buildifier_prebuilt", version = "8.5.1.3", dev_dependency = Tr
# For build_test, which is what makes the guard rules runnable under
# `bazel test`. The guards fail as *actions*, which is stronger than a test --
# anything depending on them fails too -- so they are wrapped rather than
# converted. Not a dev_dependency: //tools/flutter:defs.bzl loads it, so it has
# converted. Not a dev_dependency: //flutter/private:rules.bzl loads it, so it has
# to be visible to every consumer of the rules, which also means no consumer
# declares it for this purpose themselves.
bazel_dep(name = "bazel_skylib", version = "1.8.2")
Expand Down Expand Up @@ -51,7 +50,7 @@ bazel_dep(name = "rules_kotlin", version = "2.4.0")
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")

# Explicit rather than inherited: the native cc rules were removed from Bazel,
# so `rules_cc` has to be visible to this module for //tools/flutter:android.bzl
# so `rules_cc` has to be visible to this module for //flutter/private:android.bzl
# to load find_cc_toolchain.bzl -- which is how the strip rules reach the NDK's
# llvm-strip instead of hardcoding a path. Only the Android half needs it.
bazel_dep(name = "rules_cc", version = "0.2.17")
Expand All @@ -64,11 +63,11 @@ bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_android_ndk", version = "0.1.5")

# Wrapped rather than used directly, so an absent NDK yields a toolchain-less
# stub instead of a failed fetch. See //tools/flutter:ndk.bzl.
# stub instead of a failed fetch. See //flutter/private:ndk.bzl.
# `platforms` is declared for the Android NDK toolchain's platform constraints.
bazel_dep(name = "platforms", version = "1.0.0")

android_ndk = use_extension("//tools/flutter:ndk.bzl", "android_ndk")
android_ndk = use_extension("//flutter:extensions.bzl", "android_ndk")
use_repo(android_ndk, "androidndk", "androidndk_cmake")

remote_android_extensions = use_extension(
Expand Down
40 changes: 30 additions & 10 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading