Skip to content

Commit 417042c

Browse files
authored
GN targets for generating release artifacts (flutter#30679)
1 parent d60c816 commit 417042c

File tree

4 files changed

+112
-1
lines changed

4 files changed

+112
-1
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ allowed_hosts = [
101101
]
102102

103103
deps = {
104-
'src': 'https://github.com/flutter/buildroot.git' + '@' + '4660f4a166979c64ff56f6b856b44ccc1dba5c63',
104+
'src': 'https://github.com/flutter/buildroot.git' + '@' + '6cd24973cdf055bea3aa1ec1a0c54f2ff9a3f192',
105105

106106
# Fuchsia compatibility
107107
#

build/archives/BUILD.gn

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import("//flutter/build/zip_bundle.gni")
2+
3+
zip_bundle("artifacts") {
4+
output = "$host_os-$target_cpu/artifacts.zip"
5+
deps = [
6+
"//flutter/flutter_frontend_server:frontend_server",
7+
"//flutter/lib/snapshot:generate_snapshot_bin",
8+
"//flutter/shell/testing:testing",
9+
]
10+
files = [
11+
{
12+
source = "//third_party/icu/flutter/icudtl.dat"
13+
destination = "icudtl.dat"
14+
},
15+
{
16+
source = "$root_out_dir/gen/flutter/lib/snapshot/isolate_snapshot.bin"
17+
destination = "isolate_snapshot.bin"
18+
},
19+
{
20+
source = "$root_gen_dir/flutter/lib/snapshot/vm_isolate_snapshot.bin"
21+
destination = "vm_isolate_snapshot.bin"
22+
},
23+
{
24+
source = "$root_gen_dir/frontend_server.dart.snapshot"
25+
destination = "frontend_server.dart.snapshot"
26+
},
27+
]
28+
if (host_os == "win") {
29+
files += [
30+
{
31+
source = "$root_out_dir/flutter_tester.exe"
32+
destination = "flutter_tester"
33+
},
34+
]
35+
} else {
36+
files += [
37+
{
38+
source = "$root_out_dir/flutter_tester"
39+
destination = "flutter_tester"
40+
},
41+
]
42+
}
43+
}
44+
45+
if (host_os == "linux") {
46+
group("linux-embedder") {
47+
deps = [ "//flutter/shell/platform/embedder:linux-embedder-archive" ]
48+
}
49+
}
50+
51+
zip_bundle("flutter_patched_sdk") {
52+
output = "flutter_patched_sdk.zip"
53+
deps = [ "//flutter/lib/snapshot:strong_platform" ]
54+
files = [
55+
{
56+
source = "$root_out_dir/flutter_patched_sdk/vm_outline_strong.dill"
57+
destination = "vm_outline_strong.dill"
58+
},
59+
{
60+
source = "$root_out_dir/flutter_patched_sdk/platform_strong.dill"
61+
destination = "platform_strong.dill"
62+
},
63+
]
64+
}

shell/platform/embedder/BUILD.gn

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# found in the LICENSE file.
44

55
import("//build/toolchain/clang.gni")
6+
import("//flutter/build/zip_bundle.gni")
67
import("//flutter/common/config.gni")
78
import("//flutter/shell/gpu/gpu.gni")
89
import("//flutter/shell/platform/embedder/embedder.gni")
@@ -410,3 +411,23 @@ group("flutter_engine") {
410411
}
411412
}
412413
}
414+
415+
if (host_os == "linux") {
416+
zip_bundle("linux-embedder-archive") {
417+
output = "${host_os}-${target_cpu}/${host_os}-${target_cpu}-embedder"
418+
deps = [
419+
"//flutter/shell/platform/embedder:copy_headers",
420+
"//flutter/shell/platform/embedder:flutter_engine_library",
421+
]
422+
files = [
423+
{
424+
source = "$root_out_dir/flutter_embedder.h"
425+
destination = "flutter_embedder.h"
426+
},
427+
{
428+
source = "$root_out_dir/libflutter_engine.so"
429+
destination = "libflutter_engine.so"
430+
},
431+
]
432+
}
433+
}

shell/platform/linux/BUILD.gn

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
assert(is_linux)
66

7+
import("//flutter/build/zip_bundle.gni")
78
import("//flutter/shell/platform/glfw/config.gni")
89
import("//flutter/testing/testing.gni")
910

@@ -244,3 +245,28 @@ copy("publish_headers_linux") {
244245
sources = _public_headers
245246
outputs = [ "$root_out_dir/flutter_linux/{{source_file_part}}" ]
246247
}
248+
249+
zip_bundle("flutter_gtk") {
250+
output = "$host_os-$target_cpu-flutter-gtk.zip"
251+
deps = [
252+
":flutter_linux_gtk",
253+
":publish_headers_linux",
254+
]
255+
sources = get_target_outputs(":publish_headers_linux")
256+
tmp_files = []
257+
foreach(source, sources) {
258+
tmp_files += [
259+
{
260+
source = source
261+
destination = rebase_path(source, "$root_build_dir")
262+
},
263+
]
264+
}
265+
tmp_files += [
266+
{
267+
source = "$root_build_dir/libflutter_${host_os}_gtk.so"
268+
destination = "libflutter_${host_os}_gtk.so"
269+
},
270+
]
271+
files = tmp_files
272+
}

0 commit comments

Comments
 (0)