From 4c63032ed06f2f6b1604d19eefb3aaa20e69f47e Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 18 Oct 2017 11:23:46 -0700 Subject: [PATCH] Add Fuchsia package() declaration (#4239) This declaration makes it easier for Fuchsia to include Flutter in the system image. --- BUILD.gn | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 84e7b9763db..a96d363dbc3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -5,7 +5,7 @@ group("flutter") { testonly = true - deps = [ + public_deps = [ "$flutter_root/lib/snapshot:compile_platform", "$flutter_root/lib/snapshot:generate_snapshot_bin", "$flutter_root/sky", @@ -14,15 +14,15 @@ group("flutter") { if (!is_fuchsia) { if (current_toolchain == host_toolchain) { - deps += [ - "//dart:create_sdk", + public_deps += [ "$flutter_root/frontend_server", + "//dart:create_sdk", ] } } if (is_fuchsia) { - deps += [ + public_deps += [ "$flutter_root/content_handler", "$flutter_root/content_handler:aot_content_handler", "$flutter_root/examples", @@ -33,12 +33,13 @@ group("flutter") { # If on the host, compile all unittests targets. if (current_toolchain == host_toolchain) { if (is_mac) { - deps += [ "$flutter_root/shell/platform/darwin:flutter_channels_unittests" ] + public_deps += + [ "$flutter_root/shell/platform/darwin:flutter_channels_unittests" ] } if (!is_win) { - deps += [ "$flutter_root/shell/platform/embedder:flutter_engine" ] + public_deps += [ "$flutter_root/shell/platform/embedder:flutter_engine" ] } - deps += [ + public_deps += [ "$flutter_root/flow:flow_unittests", "$flutter_root/fml:fml_unittests", "$flutter_root/sky/engine/wtf:wtf_unittests", @@ -51,12 +52,30 @@ group("flutter") { } config("config") { - include_dirs = [ - "..", - ] + include_dirs = [ ".." ] } -if (!is_fuchsia) { +if (is_fuchsia) { + import("//packages/package.gni") + + package("package") { + app = true + testonly = true + + package_name = "flutter" + + deps = [ ":flutter" ] + + binaries = [ + { + name = "flutter_runner" + }, + { + name = "flutter_aot_runner" + }, + ] + } +} else { group("dist") { testonly = true