Skip to content
Closed
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
6 changes: 5 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 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")
load("//tools/flutter:android.bzl", "flutter_assets_dir")

# 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
Expand Down
8 changes: 4 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module(
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 @@ -21,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 @@ -50,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 @@ -63,7 +63,7 @@ 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")

Expand Down
10 changes: 5 additions & 5 deletions MODULE.bazel.lock

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

14 changes: 7 additions & 7 deletions examples/demo_app/MODULE.bazel.lock

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

14 changes: 7 additions & 7 deletions examples/local_plugin/MODULE.bazel.lock

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

10 changes: 5 additions & 5 deletions examples/no_plugins/MODULE.bazel.lock

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

14 changes: 7 additions & 7 deletions examples/pub_plugins/MODULE.bazel.lock

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

2 changes: 1 addition & 1 deletion flutter/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("//tools/flutter:abis.bzl", "MODES")
load("//flutter/private:abis.bzl", "MODES")

package(default_visibility = ["//visibility:public"])

Expand Down
36 changes: 19 additions & 17 deletions flutter/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
"""Supported BUILD-file API for Flutter Consumer Modules.

Consumer BUILD files load this entrypoint, not ``//tools/flutter``. These
exports are the complete consumer contract; implementation may move without a
consumer migration.
Consumer BUILD files load this one entrypoint rather than the implementation
under ``//flutter/private``. The public names below are the complete contract
exercised by the consumer API fixture; implementation files can move without
another consumer migration.
"""

load("//tools/flutter:abis.bzl", _ABIS = "ABIS")
load("//flutter/private:abis.bzl", _ABIS = "ABIS")
load(
"//tools/flutter:android.bzl",
"//flutter/private:android.bzl",
_android_native_lib_jar = "android_native_lib_jar",
_flutter_android_binary = "flutter_android_binary",
_flutter_android_libs = "flutter_android_libs",
_jni_lib_jar = "jni_lib_jar",
_strip_native_libs = "strip_native_libs",
)
load(
"//tools/flutter:defs.bzl",
"//flutter/private:embedding.bzl",
_flutter_embedding_library = "flutter_embedding_library",
)
load("//flutter/private:pubspec.bzl", _flutter_pubspec = "flutter_pubspec")
load(
"//flutter/private:recipe.bzl",
_flutter_native_contribution = "flutter_native_contribution",
_flutter_native_libs = "flutter_native_libs",
)
load(
"//flutter/private:rules.bzl",
_dart_kernel = "dart_kernel",
_flutter_aot_library = "flutter_aot_library",
_flutter_app = "flutter_app",
_flutter_assets = "flutter_assets",
_pub_path_deps_check = "pub_path_deps_check",
_pub_plugins_check = "pub_plugins_check",
)
load(
"//tools/flutter:embedding.bzl",
_flutter_embedding_library = "flutter_embedding_library",
)
load("//tools/flutter:pubspec.bzl", _flutter_pubspec = "flutter_pubspec")
load(
"//tools/flutter:recipe.bzl",
_flutter_native_contribution = "flutter_native_contribution",
_flutter_native_libs = "flutter_native_libs",
)

# Assigning these names re-exports them to downstream BUILD files.
# Explicit assignments make the curated names exports of this module. Merely
# importing names with load() does not re-export them to downstream BUILD files.
ABIS = _ABIS
android_native_lib_jar = _android_native_lib_jar
dart_kernel = _dart_kernel
Expand Down
9 changes: 5 additions & 4 deletions flutter/extensions.bzl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Supported module-extension API for Flutter Consumer Modules.

Consumer Modules load this entrypoint, not ``//tools/flutter``. SDK/engine
provisioning stays private because it supplies the Ruleset Module's tool inputs.
Consumer Modules load this entrypoint rather than the implementation under
``//flutter/private``. The Flutter SDK/engine provisioning extension stays
private to the Ruleset Module because it supplies the rules' own tool inputs.
"""

load("//tools/flutter:ndk.bzl", _android_ndk = "android_ndk")
load("//tools/flutter:plugins.bzl", _flutter_plugins_ext = "flutter_plugins_ext")
load("//flutter/private:ndk.bzl", _android_ndk = "android_ndk")
load("//flutter/private:plugins.bzl", _flutter_plugins_ext = "flutter_plugins_ext")

# Assigning these names re-exports them to downstream MODULE files.
android_ndk = _android_ndk
Expand Down
Loading
Loading