forked from dart-lang/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
755 lines (693 loc) · 21.3 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# Copyright (c) 2017, 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 GN file contains build rules for assembling the Dart SDK. There are
# two possible variants: the "Full" SDK, and the "Platform" SDK. If you want
# to make a new subset of the Full SDK, make it the same way we make
# the Platform SDK.
#
# Warning:
# If you need to copy something into dart-sdk/lib/foo in addition to the stuff
# copied there by :copy_libraries, then you must depend on ":copy_libraries",
# or ":copy_libraries" may delete/overwrite your addition, and the build will
# fail.
import("../build/dart/copy_tree.gni")
import("../build/executable_suffix.gni")
import("../sdk_args.gni")
import("../utils/application_snapshot.gni")
declare_args() {
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
dart_platform_sdk = true
# Path to stripped dart binaries relative to build output directory.
dart_stripped_binary = "dart"
dart_precompiled_runtime_stripped_binary = "dart_precompiled_runtime_product"
gen_snapshot_stripped_binary = "gen_snapshot_product"
analyze_snapshot_binary = "analyze_snapshot"
wasm_opt_stripped_binary = "wasm-opt"
dart_include_wasm_opt = true
}
# The directory layout of the SDK is as follows:
#
# ..dart-sdk/
# ....bin/
# ......dart or dart.exe (executable)
# ......dart.lib (import library for VM native extensions on Windows)
# ......dartaotruntime or dartaotruntime.exe (executable)
# ......utils/gen_snapshot or utils/gen_snapshot.exe (if not on ia32)
# ......snapshots/
# ........analysis_server.dart.snapshot
# ........dart2js.dart.snapshot
# ........dart2wasm_product.snapshot (if not on ia32)
# ........dartdev.dart.snapshot (app-jit snapshot or kernel dill file)
# ........dartdevc.dart.snapshot
# ........dds.dart.snapshot
# ........frontend_server.dart.snapshot
# ........gen_kernel.dart.snapshot (if not on ia32)
# ........kernel-service.dart.snapshot
# ........kernel_worker.dart.snapshot
# ......resources/
# ........dartdoc/
# ..........resources/
# ..........templates/
# ....include/
# ......dart_api.h
# ......dart_native_api.h
# ......dart_tools_api.h
# ....lib/
# ......libraries.json
# ......_internal/
# ........dart2js_platform.dill
# ........dart2js_platform_unsound.dill
# ........dart2js_server_platform.dill
# ........dart2js_server_platform_unsound.dill
# ........dart2wasm_outline.dill (if not on ia32)
# ........dart2wasm_platform.dill (if not on ia32)
# ........dart2wasm_stringref_outline.dill (if not on ia32)
# ........dart2wasm_stringref_platform.dill (if not on ia32)
# ........dart2wasm_js_compatibility_outline.dill (if not on ia32)
# ........dart2wasm_js_compatibility_platform.dill (if not on ia32)
# ........ddc_outline.dill
# ........ddc_platform.dill
# ........vm_platform_strong.dill
# ........js_dev_runtime/
# ........js_runtime/
# ........js_shared/
# ......async/
# ......collection/
# ......convert/
# ......core/
# ......dev_compiler/
#.........amd/require.js
#.........web/dart_stack_trace_mapper.js
# ......developer/
# ......html/
# ......_http/
# ......internal/
# ......io/
# ......isolate/
# ......js/
# ......js_interop/
# ......js_interop_unsafe/
# ......js_util/
# ......math/
# ......mirrors/
# ......typed_data/
# ......api_readme.md
# Scripts that go under bin/
_platform_sdk_scripts = []
_full_sdk_scripts = []
# Snapshots that go under bin/snapshots
_platform_sdk_snapshots = [
[
"analysis_server",
"../utils/analysis_server",
],
[
"dartdev",
"../utils/dartdev:dartdev",
],
[
"dds",
"../utils/dds:dds",
],
[
"frontend_server",
"../utils/kernel-service:frontend_server",
],
]
if (dart_snapshot_kind == "app-jit") {
_platform_sdk_snapshots += [ [
"kernel-service",
"../utils/kernel-service:kernel-service_snapshot",
] ]
}
_full_sdk_snapshots = _platform_sdk_snapshots + [
[
"dart2js",
"../utils/compiler:dart2js",
],
[
"dartdevc",
"../utils/dartdevc",
],
[
"kernel_worker",
"../utils/bazel:kernel_worker",
],
]
# Libraries that go under lib/
_full_sdk_libraries = [
"_internal",
"async",
"cli",
"collection",
"convert",
"core",
"developer",
"ffi",
"html",
"_http",
"indexed_db",
"internal",
"io",
"isolate",
"js",
"js_interop",
"js_interop_unsafe",
"js_util",
"math",
"mirrors",
"svg",
"typed_data",
"_wasm",
"web_audio",
"web_gl",
"web_sql",
]
# Apps running on the platform SDK shouldn't be using Dart4Web libraries, but
# the analyzer and dartdoc expect all the library sources to be present.
#
# _platform_sdk_libraries = [
# "_internal",
# "async",
# "cli",
# "collection",
# "convert",
# "core",
# "developer",
# "html",
# "_http",
# "internal",
# "io",
# "isolate",
# "math",
# "mirrors",
# "typed_data",
# ]
_platform_sdk_libraries = _full_sdk_libraries
# From here down to the copy_trees() invocation, we collect all the information
# about trees that need to be copied in the list of scopes, copy_tree_specs.
copy_tree_specs = []
# This rule copies dartdoc templates to
# bin/resources/dartdoc/templates
copy_tree_specs += [
{
target = "copy_dartdoc_templates"
visibility = [ ":copy_dartdoc_files" ]
source = "../third_party/pkg/dartdoc/lib/templates"
dest = "$root_out_dir/$dart_sdk_output/bin/resources/dartdoc/templates"
ignore_patterns = "{}"
},
]
# This rule copies dartdoc resources to
# bin/resources/dartdoc/resources
copy_tree_specs += [
{
target = "copy_dartdoc_resources"
visibility = [ ":copy_dartdoc_files" ]
source = "../third_party/pkg/dartdoc/lib/resources"
dest = "$root_out_dir/$dart_sdk_output/bin/resources/dartdoc/resources"
ignore_patterns = "{}"
},
]
# This rule copies the pre-built DevTools application to
# bin/resources/devtools/
copy_tree_specs += [
{
target = "copy_prebuilt_devtools"
visibility = [ ":create_common_sdk" ]
source = "../third_party/devtools/web"
dest = "$root_out_dir/$dart_sdk_output/bin/resources/devtools"
ignore_patterns = "{}"
},
]
# This loop generates rules to copy libraries to lib/
foreach(library, _full_sdk_libraries) {
copy_tree_specs += [
{
target = "copy_${library}_library"
visibility = [
":copy_full_sdk_libraries",
":copy_platform_sdk_libraries",
]
source = "lib/$library"
dest = "$root_out_dir/$dart_sdk_output/lib/$library"
ignore_patterns = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore"
},
]
}
# This generates targets for everything in copy_tree_specs. The targets have the
# same name as the "target" fields in the scopes of copy_tree_specs.
copy_trees("copy_trees") {
sources = copy_tree_specs
}
# Copies the Dart VM binary into bin/
if (target_os != current_os && target_os == "fuchsia") {
# In the Fuchsia build, this has to use a symlink for two reasons.
# First, it makes the lookup of shared libraries relative to $ORIGIN
# (Linux) or @loader_path (macOS) find the libraries where they are,
# since those lookups use the directory of the symlink target rather
# than of the link itself (as they would for a copy or hard link).
# Second, when the dart binary is built as a "variant" (e.g. with a
# sanitizer), then $root_out_dir/dart is itself a symlink to the real
# binary in the selected variant toolchain's $root_out_dir and since
# the "copy" tool is actually a hard link rather than a copy, it will
# make a link to the symlink rather than the symlink's target, and the
# relative symlink interpreted from a different containing directory
# will not find the actual binary.
action("copy_dart") {
visibility = [ ":create_common_sdk" ]
dart_label = "../runtime/bin:dart"
deps = [ dart_label ]
dart_out = get_label_info(dart_label, "root_out_dir")
sources = [ "$dart_out/$dart_stripped_binary" ]
outputs = [ "$root_out_dir/$dart_sdk_output/bin/$dart_stripped_binary" ]
script = "/bin/ln"
args = [
"-snf",
rebase_path(sources[0], get_path_info(outputs[0], "dir")),
rebase_path(outputs[0]),
]
}
} else {
copy("copy_dart") {
visibility = [ ":create_common_sdk" ]
deps = [ "../runtime/bin:dart" ]
dart_out = get_label_info("../runtime/bin:dart", "root_out_dir")
sources = [ "$dart_out/${dart_stripped_binary}${executable_suffix}" ]
if (is_win && dart_lib_export_symbols) {
sources += [ "$dart_out/dart.lib" ]
}
outputs = [ "$root_out_dir/$dart_sdk_output/bin/{{source_file_part}}" ]
}
}
copy("copy_dartaotruntime") {
visibility = [ ":group_dart2native" ]
deps = [ "../runtime/bin:dart_precompiled_runtime_product" ]
src_dir = get_label_info("../runtime/bin:dart_precompiled_runtime_product",
"root_out_dir")
sources = [
"$src_dir/${dart_precompiled_runtime_stripped_binary}${executable_suffix}",
]
outputs = [
"$root_out_dir/$dart_sdk_output/bin/dartaotruntime${executable_suffix}",
]
}
copy("copy_gen_snapshot") {
visibility = [ ":group_dart2native" ]
deps = [ "../runtime/bin:gen_snapshot_product" ]
src_dir =
get_label_info("../runtime/bin:gen_snapshot_product", "root_out_dir")
sources = [ "$src_dir/${gen_snapshot_stripped_binary}${executable_suffix}" ]
outputs = [
"$root_out_dir/$dart_sdk_output/bin/utils/gen_snapshot${executable_suffix}",
]
}
copy("copy_vm_platform_strong_product") {
visibility = [ ":group_dart2native" ]
deps = [ "../runtime/vm:vm_platform_product" ]
src_dir = get_label_info("../runtime/vm:vm_platform_product", "root_out_dir")
sources = [ "$src_dir/vm_platform_strong_product.dill" ]
outputs =
[ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ]
}
copy("copy_gen_kernel_snapshot") {
visibility = [ ":group_dart2native" ]
deps = [ "../utils/gen_kernel" ]
sources = [ "$root_gen_dir/gen_kernel.dart.snapshot" ]
outputs =
[ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ]
}
group("group_dart2native") {
deps = [
":copy_dartaotruntime",
":copy_gen_kernel_snapshot",
":copy_gen_snapshot",
":copy_vm_platform_strong_product",
]
}
# A template for copying the things in _platform_sdk_scripts and
# _full_sdk_scripts into bin/
template("copy_sdk_script") {
assert(defined(invoker.name), "copy_sdk_script must define 'name'")
name = invoker.name
ext = ""
if (is_win) {
ext = ".bat"
}
copy(target_name) {
visibility = [
":copy_full_sdk_scripts",
":copy_platform_sdk_scripts",
]
sources = [ "bin/${name}_sdk$ext" ]
outputs = [ "$root_out_dir/$dart_sdk_output/bin/$name$ext" ]
}
}
foreach(sdk_script, _full_sdk_scripts) {
copy_sdk_script("copy_${sdk_script}_script") {
name = sdk_script
}
}
# This is the main target for copying scripts in _platform_sdk_scripts to bin/
group("copy_platform_sdk_scripts") {
visibility = [ ":_create_platform_sdk" ]
public_deps = []
foreach(sdk_script, _platform_sdk_scripts) {
public_deps += [ ":copy_${sdk_script}_script" ]
}
}
# This is the main target for copying scripts in _full_sdk_scripts to bin/
group("copy_full_sdk_scripts") {
visibility = [ ":create_full_sdk" ]
public_deps = []
foreach(sdk_script, _full_sdk_scripts) {
public_deps += [ ":copy_${sdk_script}_script" ]
}
}
# This loop generates "copy" targets that put snapshots into bin/snapshots
foreach(snapshot, _full_sdk_snapshots) {
root = root_gen_dir
# The frontend_server is output to root_out_dir so that it doesn't conflict
# with the flutter snapshot by the same name under root_gen_dir.
if (snapshot[0] == "frontend_server") {
root = root_out_dir
}
copy("copy_${snapshot[0]}_snapshot") {
visibility = [
":copy_full_sdk_snapshots",
":copy_platform_sdk_snapshots",
]
deps = [ snapshot[1] ]
sources = [ "$root/${snapshot[0]}.dart.snapshot" ]
outputs =
[ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ]
}
}
# This is the main rule for copying snapshots from _platform_sdk_snapshots to
# bin/snapshots
group("copy_platform_sdk_snapshots") {
visibility = [ ":_create_platform_sdk" ]
public_deps = []
foreach(snapshot, _platform_sdk_snapshots) {
public_deps += [ ":copy_${snapshot[0]}_snapshot" ]
}
}
# This is the main rule for copying snapshots from _full_sdk_snapshots to
# bin/snapshots
group("copy_full_sdk_snapshots") {
visibility = [ ":create_full_sdk" ]
public_deps = []
foreach(snapshot, _full_sdk_snapshots) {
public_deps += [ ":copy_${snapshot[0]}_snapshot" ]
}
}
# This is the main rule for copying the files that dartdoc needs.
group("copy_dartdoc_files") {
visibility = [ ":create_common_sdk" ]
public_deps = [
":copy_dartdoc_resources",
":copy_dartdoc_templates",
]
}
# This rule copies dill files to lib/_internal.
copy("copy_vm_dill_files") {
visibility = [ ":create_common_sdk" ]
deps = [
":copy_libraries",
"../runtime/vm:kernel_platform_files",
]
sources = [ "$root_out_dir/vm_platform_strong.dill" ]
outputs =
[ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ]
}
copy("copy_dart2js_dill_files") {
visibility = [ ":create_full_sdk" ]
deps = [
":copy_libraries",
"../utils/compiler:compile_dart2js_platform",
"../utils/compiler:compile_dart2js_server_platform",
]
sources = [
"$root_out_dir/dart2js_platform.dill",
"$root_out_dir/dart2js_server_platform.dill",
]
outputs =
[ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ]
}
copy("copy_dart2wasm_platform") {
visibility = [ ":create_full_sdk" ]
deps = [
":copy_libraries",
"../:dart2wasm_platform",
"../utils/dart2wasm:compile_dart2wasm_js_compatibility_platform",
"../utils/dart2wasm:compile_dart2wasm_platform",
"../utils/dart2wasm:compile_dart2wasm_stringref_platform",
]
sources = [
"$root_out_dir/dart2wasm_js_compatibility_outline.dill",
"$root_out_dir/dart2wasm_js_compatibility_platform.dill",
"$root_out_dir/dart2wasm_outline.dill",
"$root_out_dir/dart2wasm_platform.dill",
"$root_out_dir/dart2wasm_stringref_outline.dill",
"$root_out_dir/dart2wasm_stringref_platform.dill",
]
outputs =
[ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ]
}
copy("copy_dart2wasm_snapshot") {
visibility = [ ":create_full_sdk" ]
deps = [
":copy_libraries",
"../utils/dart2wasm:dart2wasm_product_snapshot",
]
sources = [ "$root_out_dir/dart2wasm_product.snapshot" ]
outputs =
[ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ]
}
copy("copy_wasm_opt") {
visibility = [ ":create_full_sdk" ]
deps = [
":copy_libraries",
"../third_party/binaryen:wasm-opt",
]
sources = [ "$root_out_dir/${wasm_opt_stripped_binary}${executable_suffix}" ]
outputs = [ "$root_out_dir/$dart_sdk_output/bin/utils/{{source_file_part}}" ]
}
# Copies DDC's SDK full and outline .dill files to lib/_internal.
copy("copy_dev_compiler_dills") {
visibility = [ ":copy_dev_compiler_sdk" ]
deps = [
":copy_libraries",
"../utils/dartdevc:dartdevc_platform_sound",
]
sources = [
"$root_out_dir/ddc_outline.dill",
"$root_out_dir/ddc_platform.dill",
]
outputs =
[ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ]
}
# Copies require.js to lib/dev_compiler/amd.
# Used to load DDC compiled amd modules.
copy("copy_dev_compiler_amd_require_js") {
visibility = [ ":copy_dev_compiler_sdk" ]
sources = [ "../third_party/requirejs/require.js" ]
outputs = [
"$root_out_dir/$dart_sdk_output/lib/dev_compiler/amd/{{source_file_part}}",
]
}
# Copies stack_trace_mapper tool to lib/dev_compiler/web.
# Used when running DDC compiled applications.
copy("copy_dev_compiler_stack_trace_mapper") {
visibility = [ ":copy_dev_compiler_sdk" ]
deps = [ "../utils/dartdevc:stack_trace_mapper" ]
dart_out =
get_label_info("../utils/dartdevc:stack_trace_mapper", "root_out_dir")
sources = [ "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js" ]
outputs = [
"$root_out_dir/$dart_sdk_output/lib/dev_compiler/web/{{source_file_part}}",
]
}
# Main rule for copying all of DDC's dependencies to lib.
group("copy_dev_compiler_sdk") {
visibility = [ ":create_full_sdk" ]
public_deps = [
":copy_dev_compiler_amd_require_js",
":copy_dev_compiler_dills",
":copy_dev_compiler_stack_trace_mapper",
]
}
# This rule copies header files to include/
group("copy_headers") {
visibility = [ ":create_common_sdk" ]
deps = [ "../runtime/include:copy_headers" ]
}
# This rule copies libraries.json files to lib/
copy("copy_libraries_specification") {
visibility = [ ":create_common_sdk" ]
sources = [ "lib/libraries.json" ]
deps = [ ":copy_libraries" ]
outputs = [ "$root_out_dir/$dart_sdk_output/lib/{{source_file_part}}" ]
}
# This is the main rule to copy libraries in _platform_sdk_libraries to lib/
group("copy_platform_sdk_libraries") {
visibility = [
":_create_platform_sdk",
":copy_libraries",
]
public_deps = []
foreach(library, _platform_sdk_libraries) {
public_deps += [ ":copy_${library}_library" ]
}
}
# This is the main rule to copy libraries in _full_sdk_libraries to lib/
group("copy_full_sdk_libraries") {
visibility = [
":copy_libraries",
":create_full_sdk",
]
public_deps = []
foreach(library, _full_sdk_libraries) {
public_deps += [ ":copy_${library}_library" ]
}
}
group("copy_libraries") {
if (dart_platform_sdk) {
public_deps = [ ":copy_platform_sdk_libraries" ]
} else {
public_deps = [ ":copy_full_sdk_libraries" ]
}
}
# This rule writes the version file.
action("write_version_file") {
visibility = [ ":create_common_sdk" ]
inputs = [
"../tools/VERSION",
"$default_git_folder/logs/HEAD",
]
output = "$root_out_dir/$dart_sdk_output/version"
outputs = [ output ]
script = "../tools/write_version_file.py"
args = [
"--output",
rebase_path(output),
]
}
# This rule writes the revision file.
action("write_revision_file") {
visibility = [ ":create_common_sdk" ]
inputs = [ "$default_git_folder/logs/HEAD" ]
output = "$root_out_dir/$dart_sdk_output/revision"
outputs = [ output ]
script = "../tools/write_revision_file.py"
args = [
"--output",
rebase_path(output),
]
}
# This rule copies the README file.
copy("copy_readme") {
visibility = [ ":create_common_sdk" ]
sources = [ "../README.dart-sdk" ]
outputs = [ "$root_out_dir/$dart_sdk_output/README" ]
}
# This rule copies the LICENSE file.
copy("copy_license") {
visibility = [ ":create_common_sdk" ]
sources = [ "../LICENSE" ]
outputs = [ "$root_out_dir/$dart_sdk_output/LICENSE" ]
}
# This rule generates a custom dartdoc_options.yaml file.
action("write_dartdoc_options") {
visibility = [ ":create_common_sdk" ]
inputs = [ "$default_git_folder/logs/HEAD" ]
output = "$root_out_dir/$dart_sdk_output/dartdoc_options.yaml"
outputs = [ output ]
script = "../tools/write_dartdoc_options_file.py"
args = [
"--output",
rebase_path(output),
]
}
# This rule copies the API readme file to lib/
copy("copy_api_readme") {
visibility = [ ":create_common_sdk" ]
sources = [ "api_readme.md" ]
outputs = [ "$root_out_dir/$dart_sdk_output/lib/api_readme.md" ]
}
# Parts common to both platform and full SDKs.
group("create_common_sdk") {
visibility = [
":create_platform_sdk",
":create_sdk",
]
public_deps = [
":copy_api_readme",
":copy_dart",
":copy_dartdoc_files",
":copy_headers",
":copy_libraries_specification",
":copy_license",
":copy_prebuilt_devtools",
":copy_readme",
":copy_vm_dill_files",
":write_dartdoc_options",
":write_revision_file",
":write_version_file",
]
# We do not support AOT on ia32 and should therefore not add the
# dart native compilation files since there is no AOT compiler/runtime
# available.
if (dart_target_arch != "ia32" && dart_target_arch != "x86") {
public_deps += [ ":group_dart2native" ]
}
}
# Parts specific to the platform SDK.
group("_create_platform_sdk") {
visibility = [
":create_platform_sdk",
":create_sdk",
]
public_deps = [
":copy_platform_sdk_libraries",
":copy_platform_sdk_scripts",
":copy_platform_sdk_snapshots",
]
}
# Parts specific to the full SDK.
group("create_full_sdk") {
visibility = [ ":create_sdk" ]
public_deps = [
":copy_dart2js_dill_files",
":copy_dev_compiler_sdk",
":copy_full_sdk_libraries",
":copy_full_sdk_scripts",
":copy_full_sdk_snapshots",
]
if (dart_target_arch != "ia32" && dart_target_arch != "x86") {
public_deps += [
":copy_dart2wasm_platform",
":copy_dart2wasm_snapshot",
]
if (dart_include_wasm_opt) {
public_deps += [ ":copy_wasm_opt" ]
}
}
}
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
group("create_platform_sdk") {
public_deps = [
":_create_platform_sdk",
":create_common_sdk",
]
}
# The main target to depend on from ../BUILD.gn
group("create_sdk") {
public_deps = [ ":create_common_sdk" ]
if (dart_platform_sdk) {
public_deps += [ ":_create_platform_sdk" ]
} else {
public_deps += [ ":create_full_sdk" ]
}
}