forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zip_bundle.gni
59 lines (55 loc) · 1.61 KB
/
zip_bundle.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/common/config.gni")
if (flutter_runtime_mode == "jit_release") {
android_zip_archive_dir = "android-$target_cpu-jit-release"
} else {
android_zip_archive_dir = "android-$target_cpu"
}
# Creates a zip file in the $root_build_dir/zip_archives folder.
#
# The output variable specifies the name of the zip file to create.
# The files variable is an array of scopes that specify a source file or
# directory and a destination path in the archive to create.
#
# For example, to create a zip file named archive.zip with all files in the
# root directory of the archive:
#
# zip_bundle("sample") {
# output = "archive.zip"
# files = [
# {
# source = "$root_build_dir/some/path/to/lib.so"
# destination = "lib.so"
# },
# {
# source = "$root_build_dir/some/other/path/with/files"
# destination = "other_files"
# },
# ]
# }
template("zip_bundle") {
assert(defined(invoker.output), "output must be defined")
assert(defined(invoker.files), "files must be defined as a list of scopes")
action(target_name) {
script = "//flutter/build/zip.py"
outputs = [
"$root_build_dir/zip_archives/${invoker.output}",
]
inputs = []
deps = invoker.deps
args = [
"-o",
rebase_path(outputs[0]),
]
foreach(input, invoker.files) {
args += [
"-i",
rebase_path(input.source),
rebase_path(input.destination),
]
inputs += [ input.source ]
}
}
}