Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 235e448

Browse files
author
Kaushik Iska
committed
Add templates to generate fuchsia host bundles
This is part of an effort to separate generation of host artifacts and target artifacts for fuchsia. The `fuchsia_host_bundle` template aims to capture all the artifacts that are specific to a given host. The next step would be to bundle these are separate CIPD packages for mac and linux (only x64 hosts) internal planning doc: go/flutter-fuchsia-packaging
1 parent 5e65445 commit 235e448

File tree

3 files changed

+73
-5
lines changed

3 files changed

+73
-5
lines changed

shell/platform/fuchsia/BUILD.gn

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,75 @@
44

55
import("//build/fuchsia/sdk.gni")
66
import("$flutter_root/common/config.gni")
7+
import("$flutter_root/tools/fuchsia/dart.gni")
8+
import("$flutter_root/tools/fuchsia/fuchsia_host_bundle.gni")
79

810
if (using_fuchsia_sdk) {
911
testonly = true
1012

1113
product_suffix = ""
14+
is_product = false
1215

1316
if (flutter_runtime_mode == "release") {
1417
product_suffix = "product_"
18+
is_product = true
19+
}
20+
21+
fuchsia_host_bundle("flutter_binaries") {
22+
name = "flutter_binaries"
23+
24+
_flutter_tester_label = "//flutter/shell/testing:testing($host_toolchain)"
25+
26+
deps = [
27+
_flutter_tester_label,
28+
]
29+
30+
_flutter_tester_bin_path =
31+
rebase_path(get_label_info(_flutter_tester_label, "root_out_dir") +
32+
"/flutter_tester")
33+
34+
sources = [
35+
_flutter_tester_bin_path,
36+
]
37+
}
38+
39+
fuchsia_host_bundle("dart_binaries") {
40+
name = "dart_binaries"
41+
42+
_gen_snapshot_to_use = gen_snapshot + "($host_toolchain)"
43+
if (is_product) {
44+
_gen_snapshot_to_use = gen_snapshot_product + "($host_toolchain)"
45+
}
46+
47+
_kernel_compiler_label = "dart:kernel_compiler($host_toolchain)"
48+
49+
deps = [
50+
_gen_snapshot_to_use,
51+
_kernel_compiler_label,
52+
]
53+
54+
_gen_snapshot_bin_path =
55+
rebase_path(get_label_info(_gen_snapshot_to_use, "root_out_dir") + "/" +
56+
get_label_info(_gen_snapshot_to_use, "name"))
57+
58+
_kernel_compiler_path =
59+
rebase_path(get_label_info(_kernel_compiler_label, "root_gen_dir") +
60+
"/kernel_compiler.dart.snapshot")
61+
62+
sources = [
63+
_gen_snapshot_bin_path,
64+
_kernel_compiler_path,
65+
]
1566
}
1667

1768
group("fuchsia") {
1869
deps = [
19-
"dart:kernel_compiler",
70+
":dart_binaries",
71+
":flutter_binaries",
2072
"dart_runner:dart_aot_${product_suffix}runner",
2173
"dart_runner:dart_jit_${product_suffix}runner",
2274
"flutter:flutter_aot_${product_suffix}runner",
2375
"flutter:flutter_jit_${product_suffix}runner",
24-
"flutter:flutter_runner_tests",
25-
"//flutter/shell/testing:testing($host_toolchain)",
2676
]
2777
}
2878
}

shell/testing/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import("//build/fuchsia/sdk.gni")
66

77
executable("testing") {
8-
testonly = true
9-
108
output_name = "flutter_tester"
119

1210
public_configs = [
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2013 The Flutter Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
template("fuchsia_host_bundle") {
6+
assert(defined(invoker.name), "'name' must be defined for $target_name.")
7+
dest_dir = "${root_out_dir}/host_bundle/${invoker.name}-${host_os}-${host_cpu}"
8+
9+
copy(target_name) {
10+
if (defined(invoker.deps)) {
11+
deps = invoker.deps
12+
}
13+
14+
sources = invoker.sources
15+
16+
outputs = [
17+
"$dest_dir/{{source_file_part}}",
18+
]
19+
}
20+
}

0 commit comments

Comments
 (0)