forked from dart-lang/sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.gn
248 lines (218 loc) · 5.9 KB
/
BUILD.gn
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# This target will be built if no target is specified when invoking ninja.
group("default") {
if (defined(is_fuchsia) && (is_fuchsia || is_fuchsia_host)) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
}
deps = [
":runtime",
]
}
group("most") {
if (defined(is_fuchsia) && (is_fuchsia || is_fuchsia_host)) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
}
deps = [
":analysis_server",
":create_sdk",
":dart2js",
":dartanalyzer",
":dartdevc",
":runtime",
":samples",
]
}
group("runtime") {
if (defined(is_fuchsia) && (is_fuchsia || is_fuchsia_host)) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
}
deps = [
"runtime/bin:dart",
"runtime/bin:dart_bootstrap($host_toolchain)",
"runtime/bin:process_test",
"runtime/bin:run_vm_tests",
"runtime/bin:sample_extension",
"runtime/bin:test_extension",
"runtime/vm:patched_sdk",
]
}
group("runtime_precompiled") {
deps = [
"runtime/bin:dart_bootstrap($host_toolchain)",
"runtime/bin:dart_precompiled_runtime",
"runtime/bin:process_test",
"runtime/vm:patched_sdk",
]
}
action("create_sdk") {
deps = [
"runtime/bin:dart",
"utils/analysis_server",
"utils/compiler:dart2js",
"utils/compiler:utils_wrapper",
"utils/dartanalyzer:generate_dartanalyzer_snapshot",
"utils/dartanalyzer:generate_summary_spec",
"utils/dartanalyzer:generate_summary_strong",
"utils/dartdevc",
"utils/dartdoc",
"utils/dartfmt",
"utils/pub",
]
sdk_lib_files = exec_script("tools/list_dart_files.py",
[
"absolute",
rebase_path("sdk/lib"),
],
"list lines")
preamble_files =
exec_script("tools/list_files.py",
[
"absolute",
"",
rebase_path("sdk/lib/_internal/js_runtime/lib/preambles"),
],
"list lines")
sdk_bin_files = exec_script("tools/list_files.py",
[
"absolute",
"",
rebase_path("sdk/bin"),
],
"list lines")
inputs = sdk_lib_files + preamble_files + sdk_bin_files + [
"sdk/lib/dart_client.platform",
"sdk/lib/dart_server.platform",
"sdk/lib/dart_shared.platform",
"$root_gen_dir/dart2js.dart.snapshot",
"$root_gen_dir/utils_wrapper.dart.snapshot",
"$root_gen_dir/pub.dart.snapshot",
"$root_gen_dir/dartanalyzer.dart.snapshot",
"$root_gen_dir/dartdevc.dart.snapshot",
"$root_gen_dir/dartfmt.dart.snapshot",
"$root_gen_dir/analysis_server.dart.snapshot",
"$root_gen_dir/dartdoc.dart.snapshot",
"$root_gen_dir/spec.sum",
"$root_gen_dir/strong.sum",
"tools/VERSION",
]
outputs = [
"$root_out_dir/dart-sdk/README",
]
script = "tools/create_sdk.py"
args = [
"--sdk_output_dir",
rebase_path("$root_out_dir/dart-sdk"),
"--snapshot_location",
rebase_path("$root_gen_dir"),
]
if (defined(is_fuchsia) && is_fuchsia_host) {
args += [
"--copy_libs"
]
}
}
group("dart2js") {
deps = [
"utils/compiler:dart2js",
]
}
group("dartanalyzer") {
deps = [
"utils/dartanalyzer",
]
}
group("dartdevc") {
deps = [
"utils/dartdevc",
]
}
group("dartfmt") {
deps = [
"utils/dartfmt",
]
}
group("analysis_server") {
deps = [
"utils/analysis_server",
]
}
# This is the target that is built on the dart2js build bots.
# It must depend on anything that is required by the dart2js
# test suites.
group("dart2js_bot") {
deps = [
":create_sdk",
]
}
group("samples") {
deps = [
"runtime/bin:sample_extension",
]
}
# The rules below build a qemu Fuchsia OS image that includes the Dart tree
# under /system/test/dart. Building this image is gated by the GN argument
# 'dart_build_fuchsia_test_image' because building the image is slow.
if (defined(is_fuchsia) && (is_fuchsia)) {
declare_args() {
dart_build_fuchsia_test_image = false
}
if (dart_build_fuchsia_test_image) {
action("generate_dart_test_manifest") {
testonly = true
deps = [
"//packages/gn:mkbootfs",
]
output_prefix = "$target_gen_dir/dart_test_tree"
outputs = [
"$output_prefix.manifest",
]
mode = "release"
if (is_debug) {
mode = "debug"
}
mkbootfs_gen = get_label_info("//packages/gn:mkbootfs", "target_gen_dir")
user_manifest = "$mkbootfs_gen/user.bootfs.manifest"
script = "tools/gen_fuchsia_test_manifest.py"
args = [
"-m",
mode,
"-u",
rebase_path(user_manifest),
"-o",
rebase_path(output_prefix),
]
}
action("generate_dart_test_image") {
testonly = true
deps = [
"runtime/bin:dart",
"runtime/bin:run_vm_tests",
"runtime/bin:process_test",
":generate_dart_test_manifest",
]
input = "$target_gen_dir/dart_test_tree.manifest"
inputs = [
input,
]
output = "$root_out_dir/dart_test_tree.bin"
outputs = [
output,
]
script = "//packages/gn/make_bootfs.py"
args = [
"--manifest",
rebase_path(input),
"--output-file",
rebase_path(output),
"--build-id-map",
rebase_path("$target_gen_dir/build_id_map"),
"--compress",
]
}
}
}