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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Build targets for constructing CIPD release archives.
assert(is_fuchsia)
import("//build/util/process_version.gni")
# gn binary location.
if (host_os == "mac") {
_gn_path = "//buildtools/mac/gn"
} else if (host_os == "linux") {
_gn_path = "//buildtools/linux64/gn"
}
# Produces a consolidated license file.
action("license") {
_license_path = "${target_gen_dir}/LICENSE"
script = "//tools/licenses.py"
inputs = [
"$_gn_path",
]
outputs = [
_license_path,
]
args = [
"license_file",
rebase_path(_license_path, root_build_dir),
"--gn-target",
"//fuchsia/runners:web_runner_pkg",
"--gn-out-dir",
".",
]
}
# Extracts the numeric Chrome build ID and writes it to a file in the output
# directory.
#
# To check out the repository on the commit where the build ID was generated,
# simply call `git checkout <build-id>`, and Git will check out the commit
# associated with the <build-id> tag.
process_version("build_id") {
template_file = "build_id.template"
sources = [
"//chrome/VERSION",
]
output = "${target_gen_dir}/build_id.txt"
process_only = true
}
# Prepares a CIPD archive and generates a manifest file.
#
# Parameters:
# cipd_manifest_name: The filename to use for the generated CIPD YAML file.
# cipd_path: The path where the package will be located inside the CIPD
# repository.
# cipd_description: Sets the "description" field in CIPD metadata.
# deps: A list of targets to build prior to copying files.
# sources: A list of files to copy into the staging root.
template("cipd_archive") {
forward_variables_from(invoker,
[
"cipd_manifest_name",
"cipd_path",
"cipd_description",
"deps",
"sources",
])
archive_staging_dir = "${target_gen_dir}/${target_name}"
yaml_contents = [
"package: ${cipd_path}",
"description: ${cipd_description}",
"root: \${outdir}/" + rebase_path(archive_staging_dir, root_build_dir),
"data:",
" - file: LICENSE",
]
if (!defined(deps)) {
deps = []
}
deps += [
":build_id",
":license",
]
foreach(source, sources) {
yaml_contents += [ " - file: " + get_path_info(source, "file") ]
}
sources += get_target_outputs(":license")
write_file("${archive_staging_dir}/${cipd_manifest_name}", yaml_contents)
copy(target_name) {
testonly = true
outputs = [
"${archive_staging_dir}/{{source_file_part}}",
]
}
}
cipd_archive("webrunner") {
cipd_manifest_name = "webrunner.yaml"
cipd_path = "chromium/fuchsia/webrunner-\${targetarch}"
cipd_description = "Prebuilt Chrome and Web Runner binaries for Fuchsia."
deps = [
"//fuchsia/engine:web_engine",
"//fuchsia/runners:web_runner_pkg",
]
sources = [
"${root_gen_dir}/fuchsia/engine/chromium/chromium.far",
"${root_gen_dir}/fuchsia/runners/web_runner/web_runner.far",
]
}
cipd_archive("castrunner") {
cipd_manifest_name = "castrunner.yaml"
cipd_path = "chromium/fuchsia/castrunner-\${targetarch}"
cipd_description = "Prebuilt Cast application Runner binaries for Fuchsia."
deps = [
"//fuchsia/runners:cast_runner_pkg",
]
sources = [
"${root_gen_dir}/fuchsia/runners/cast_runner/cast_runner.far",
]
}
cipd_archive("http") {
cipd_manifest_name = "http.yaml"
cipd_path = "chromium/fuchsia/http-\${targetarch}"
cipd_description = "Prebuilt HTTP service binary for Fuchsia."
deps = [
"//fuchsia/http:http_pkg",
]
sources = [
"${root_gen_dir}/fuchsia/http/http/http.far",
]
}
cipd_archive("tests") {
_manifest_path = "${target_gen_dir}/test_manifest.json"
cipd_manifest_name = "tests.yaml"
cipd_path = "chromium/fuchsia/tests-\${targetarch}"
cipd_description = "Prebuilt Chromium tests for Fuchsia."
deps = [
"//base:base_unittests_pkg",
"//fuchsia/runners:cast_runner_integration_tests_pkg",
"//fuchsia/runners:web_runner_integration_tests_pkg",
"//ipc:ipc_tests_pkg",
"//media:media_unittests_pkg",
"//mojo:mojo_unittests_pkg",
"//skia:skia_unittests_pkg",
"//third_party/blink/common:blink_common_unittests_pkg",
]
far_sources = [
"${root_gen_dir}/base/base_unittests/base_unittests.far",
"${root_gen_dir}/fuchsia/runners/cast_runner_integration_tests/cast_runner_integration_tests.far",
"${root_gen_dir}/fuchsia/runners/web_runner_integration_tests/web_runner_integration_tests.far",
"${root_gen_dir}/ipc/ipc_tests/ipc_tests.far",
"${root_gen_dir}/media/media_unittests/media_unittests.far",
"${root_gen_dir}/mojo/mojo_unittests/mojo_unittests.far",
"${root_gen_dir}/skia/skia_unittests/skia_unittests.far",
"${root_gen_dir}/third_party/blink/common/blink_common_unittests/blink_common_unittests.far",
]
# Build a JSON manifest of the tests and include it in the archive.
_manifest_contents = []
foreach(source, far_sources) {
package_name = get_path_info(source, "name")
_manifest_contents += [
{
package = package_name
component_name = package_name
},
]
}
write_file(_manifest_path, _manifest_contents, "json")
sources = far_sources + [ _manifest_path ]
}
cipd_archive("debug_symbols") {
cipd_manifest_name = "debug_symbols.yaml"
cipd_path = "chromium/fuchsia/debug-symbols-\${targetarch}"
cipd_description = "Debugging symbols for prebuilt binaries from Chromium."
_symbol_tarballs = [
"${root_gen_dir}/fuchsia/engine/chromium/chromium.symbols.tar.bz2",
"${root_gen_dir}/fuchsia/runners/cast_runner/cast_runner.symbols.tar.bz2",
"${root_gen_dir}/fuchsia/runners/web_runner/web_runner.symbols.tar.bz2",
]
_symbol_manifest = "$target_gen_dir/debug_symbols.json"
write_file(_symbol_manifest, _symbol_tarballs, "json")
_symbol_manifest_contents = []
foreach(_symbol_file, _symbol_tarballs) {
_symbol_manifest_contents += [ get_path_info(_symbol_file, "file") ]
}
write_file(_symbol_manifest, _symbol_manifest_contents, "json")
deps = [
"//fuchsia/engine:symbol_archive",
"//fuchsia/runners:cast_runner_symbol_archive",
"//fuchsia/runners:web_runner_symbol_archive",
]
sources = [ _symbol_manifest ] + _symbol_tarballs
}
group("cipd") {
testonly = true
deps = [
":castrunner",
":debug_symbols",
":http",
":tests",
":webrunner",
]
}
|