| load( |
| "@rules_fuchsia//fuchsia:defs.bzl", |
| "fuchsia_component", |
| "fuchsia_package", |
| "fuchsia_package_resource_group", |
| ) |
| |
| # To rebuild the Flutter app with new changes: |
| # ~/flutter-embedder $ cd examples/hello_flutter |
| # .../hello_flutter $ flutter build bundle |
| # |
| # TODO(akbiggs): Build these assets using a build rule like flutter_application |
| # instead of building them using the Flutter tool and then copying them over. |
| fuchsia_package_resource_group( |
| name = "assets", |
| srcs = glob(["build/flutter_assets/**/*"]), |
| dest = "data", |
| strip_prefix = "build", |
| ) |
| |
| # The embedder manifest specifies that the bundled assets for the Flutter application |
| # to run will be located at /pkg/data/flutter_assets. To create a component that |
| # runs a specific Flutter app, we package the embedder manifest together with the |
| # embedder binary and the assets for the specific Flutter app we want to run. |
| # |
| # TODO(akbiggs): After writing a few more example apps, simplify into a build rule |
| # like flutter_application. |
| fuchsia_component( |
| name = "component", |
| manifest = "//src/embedder:embedder_manifest", |
| deps = [ |
| ":assets", |
| "//src/embedder", |
| ], |
| ) |
| |
| fuchsia_package( |
| name = "hello_flutter_pkg", |
| package_name = "hello_flutter", |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":component", |
| "//src/embedder/engine:libflutter_engine_pkg_resource", |
| ], |
| ) |