blob: 2b9478619d101dcce8af6e09148b732e966e47d9 [file] [log] [blame]
# Forked from https://github.com/flutter/website/blob/main/examples/animation/animate5/lib/main.dart.
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/animation_example
# .../animation_example $ 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 = "animation_example_pkg",
package_name = "animation_example",
visibility = ["//visibility:public"],
deps = [
":component",
# TODO(akbiggs): Enable switching between debug/release
# builds of libflutter_engine.so without manually modifying
# this file.
"//src/embedder/engine/debug_x64:libflutter_engine_pkg_resource",
],
)