blob: cec1692a682d9fbff14cde3c01bcdb89ff26c307 [file] [log] [blame]
load(
"@rules_fuchsia//fuchsia:defs.bzl",
"fuchsia_component",
"fuchsia_package",
)
# To rebuild the Flutter app with new changes:
# ~/flutter-embedder $ cd examples/flutter_sample_app
# flutter_sample_app $ flutter build bundle
#
# TODO(akbiggs): Grab subdirectories and ensure their names are preserved
# in the output package's data.
# 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.
# TODO(fxbug.dev/96417): Support folders/globs in fuchsia_package_resource.
filegroup(
name = "assets",
srcs = glob([
"build/flutter_assets/*",
]),
)
# 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",
content = {
":assets": "data/flutter_assets/",
},
deps = [
"//src/embedder",
],
)
fuchsia_package(
name = "flutter_sample_app_pkg",
package_name = "flutter_sample_app",
visibility = ["//visibility:public"],
deps = [
":component",
"//src/embedder/engine:flutter_engine_pkg_resource",
],
)