OLD | NEW |
1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import("../../build/executable_suffix.gni") | 5 import("../../build/executable_suffix.gni") |
6 import("../../build/prebuilt_dart_sdk.gni") | 6 import("../../build/prebuilt_dart_sdk.gni") |
7 import("gypi_contents.gni") | 7 import("gypi_contents.gni") |
8 | 8 |
9 config("libdart_vm_config") { | 9 config("libdart_vm_config") { |
10 if (defined(is_fuchsia) && is_fuchsia) { | 10 if (defined(is_fuchsia) && is_fuchsia) { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 inputs = [] | 371 inputs = [] |
372 output = invoker.output | 372 output = invoker.output |
373 script = "../tools/concatenate_patches.py" | 373 script = "../tools/concatenate_patches.py" |
374 args = [ | 374 args = [ |
375 "--output", | 375 "--output", |
376 rebase_path(output, root_build_dir), | 376 rebase_path(output, root_build_dir), |
377 ] | 377 ] |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 if (!defined(is_fuchsia) || !is_fuchsia) { | 381 template("generate_patched_sdk") { |
382 template("generate_patched_sdk") { | 382 assert(defined(invoker.libraries), "Need libraries in $target_name") |
383 assert(defined(invoker.libraries), "Need libraries in $target_name") | |
384 | 383 |
385 concatenation_target_names = [] | 384 concatenation_target_names = [] |
386 concatenation_files = [] | 385 concatenation_files = [] |
387 | 386 |
388 # Concatenate vm library patches. | 387 # Concatenate vm library patches. |
389 foreach(library, invoker.libraries) { | 388 foreach(library, invoker.libraries) { |
390 name = library[0] | 389 name = library[0] |
391 | 390 |
392 target_output = "$target_gen_dir/patches/${name}_patch.dart" | 391 target_output = "$target_gen_dir/patches/${name}_patch.dart" |
393 concatenate_patch("concatenate_${name}_patch") { | 392 concatenate_patch("concatenate_${name}_patch") { |
394 libsources = rebase_path(library[1], ".", library[2]) | 393 libsources = rebase_path(library[1], ".", library[2]) |
395 output = target_output | 394 output = target_output |
396 } | 395 } |
397 concatenation_target_names += [ ":concatenate_${name}_patch" ] | 396 concatenation_target_names += [ ":concatenate_${name}_patch" ] |
398 concatenation_files += [ target_output ] | 397 concatenation_files += [ target_output ] |
| 398 } |
| 399 |
| 400 # Build the patched sdk out of the concatenated patches and the special |
| 401 # libraries. |
| 402 action(target_name) { |
| 403 deps = concatenation_target_names |
| 404 if (!prebuilt_dart_exe_works) { |
| 405 deps += [ "../bin:dart_bootstrap($host_toolchain)" ] |
399 } | 406 } |
400 | 407 |
401 # Build the patched sdk out of the concatenated patches and the special | 408 patches_dir = "$target_gen_dir/patches" |
402 # libraries. | 409 patched_sdk_dir = "$root_out_dir/patched_sdk" |
403 action(target_name) { | |
404 deps = concatenation_target_names | |
405 if (!prebuilt_dart_exe_works) { | |
406 deps += [ "../bin:dart_bootstrap($host_toolchain)" ] | |
407 } | |
408 | 410 |
409 patches_dir = "$target_gen_dir/patches" | 411 script = "../../tools/patch_sdk.py" |
410 patched_sdk_dir = "$root_out_dir/patched_sdk" | |
411 | 412 |
412 script = "../../tools/patch_sdk.py" | 413 # We list all files which make up the sdk (modulo patches) and get them |
| 414 # back as a GN list object. |
| 415 shared_sdk_sources = exec_script("../../tools/list_dart_files.py", |
| 416 [ |
| 417 "absolute", |
| 418 rebase_path("../../sdk/lib"), |
| 419 ], |
| 420 "list lines") |
413 | 421 |
414 # We list all files which make up the sdk (modulo patches) and get them | 422 # We list the `patch_sdk.dart` tool here because the [script] (which is |
415 # back as a GN list object. | 423 # implicitly an input) will call it. |
416 shared_sdk_sources = exec_script("../../tools/list_dart_files.py", | 424 inputs = [ |
417 [ | 425 "../../tools/patch_sdk.dart", |
418 "absolute", | 426 ] |
419 rebase_path("../../sdk/lib"), | |
420 ], | |
421 "list lines") | |
422 | 427 |
423 # We list the `patch_sdk.dart` tool here because the [script] (which is | 428 # Files below are not patches, they will not be in [concatenation_files] |
424 # implicitly an input) will call it. | 429 # but the `patch_sdk.dart` script will copy them into the patched sdk. |
425 inputs = [ | 430 inputs += [ |
426 "../../tools/patch_sdk.dart", | 431 "../lib/typed_data.dart", |
427 ] | 432 "../bin/builtin.dart", |
| 433 "../bin/vmservice/vmservice_io.dart", |
| 434 "../bin/vmservice/loader.dart", |
| 435 "../bin/vmservice/server.dart", |
| 436 ] |
428 | 437 |
429 # Files below are not patches, they will not be in [concatenation_files] | 438 # Add all the normal sdk sources. |
430 # but the `patch_sdk.dart` script will copy them into the patched sdk. | 439 inputs += shared_sdk_sources |
431 inputs += [ | |
432 "../lib/typed_data.dart", | |
433 "../bin/builtin.dart", | |
434 "../bin/vmservice/vmservice_io.dart", | |
435 "../bin/vmservice/loader.dart", | |
436 "../bin/vmservice/server.dart", | |
437 ] | |
438 | 440 |
439 # Add all the normal sdk sources. | 441 # Add all the concatenated patch files. |
440 inputs += shared_sdk_sources | 442 inputs += concatenation_files |
441 | 443 |
442 # Add all the concatenated patch files. | 444 outputs = [ |
443 inputs += concatenation_files | 445 # Instead of listing all outputs we list a single well-known one. |
| 446 "${patched_sdk_dir}/lib/core/core.dart", |
| 447 ] |
444 | 448 |
445 outputs = [ | 449 args = [ "--quiet"] |
446 # Instead of listing all outputs we list a single well-known one. | 450 if (!prebuilt_dart_exe_works) { |
447 "${patched_sdk_dir}/lib/core/core.dart", | 451 dart_out_dir = get_label_info("../bin:dart_bootstrap($host_toolchain)", |
448 ] | 452 "root_out_dir") |
449 | 453 dart_bootstrap = |
450 args = [] | 454 rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") |
451 if (!prebuilt_dart_exe_works) { | |
452 dart_out_dir = get_label_info("../bin:dart_bootstrap($host_toolchain)", | |
453 "root_out_dir") | |
454 dart_bootstrap = | |
455 rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") | |
456 args += [ | |
457 "--dart-executable", | |
458 dart_bootstrap, | |
459 ] | |
460 } | |
461 args += [ | 455 args += [ |
462 "vm", | 456 "--dart-executable", |
463 rebase_path("../../sdk"), | 457 dart_bootstrap, |
464 rebase_path(patches_dir, root_build_dir), | |
465 rebase_path(patched_sdk_dir, root_build_dir), | |
466 ] | 458 ] |
467 } | 459 } |
468 } | 460 args += [ |
469 | 461 "vm", |
470 generate_patched_sdk("patched_sdk") { | 462 rebase_path("../../sdk"), |
471 libraries = [ | 463 rebase_path(patches_dir, root_build_dir), |
472 [ | 464 rebase_path(patched_sdk_dir, root_build_dir), |
473 "async", | |
474 processed_gypis.async_runtime_sources, | |
475 "../lib", | |
476 ], | |
477 [ | |
478 "collection", | |
479 processed_gypis.collection_runtime_sources, | |
480 "../lib", | |
481 ], | |
482 [ | |
483 "convert", | |
484 processed_gypis.convert_runtime_sources, | |
485 "../lib", | |
486 ], | |
487 [ | |
488 "core", | |
489 processed_gypis.core_runtime_sources, | |
490 "../lib", | |
491 ], | |
492 [ | |
493 "developer", | |
494 processed_gypis.developer_runtime_sources, | |
495 "../lib", | |
496 ], | |
497 [ | |
498 "internal", | |
499 processed_gypis.internal_runtime_sources, | |
500 "../lib", | |
501 ], | |
502 [ | |
503 "isolate", | |
504 processed_gypis.isolate_runtime_sources, | |
505 "../lib", | |
506 ], | |
507 [ | |
508 "math", | |
509 processed_gypis.math_runtime_sources, | |
510 "../lib", | |
511 ], | |
512 [ | |
513 "mirrors", | |
514 processed_gypis.mirrors_runtime_sources, | |
515 "../lib", | |
516 ], | |
517 [ | |
518 "profiler", | |
519 processed_gypis.profiler_runtime_sources, | |
520 "../lib", | |
521 ], | |
522 [ | |
523 "vmservice", | |
524 processed_gypis.vmservice_runtime_sources, | |
525 "../lib", | |
526 ], | |
527 [ | |
528 "io", | |
529 processed_gypis.bin_io_sources, | |
530 "../bin", | |
531 ], | |
532 ] | 465 ] |
533 } | 466 } |
534 } | 467 } |
| 468 |
| 469 generate_patched_sdk("patched_sdk") { |
| 470 libraries = [ |
| 471 [ |
| 472 "async", |
| 473 processed_gypis.async_runtime_sources, |
| 474 "../lib", |
| 475 ], |
| 476 [ |
| 477 "collection", |
| 478 processed_gypis.collection_runtime_sources, |
| 479 "../lib", |
| 480 ], |
| 481 [ |
| 482 "convert", |
| 483 processed_gypis.convert_runtime_sources, |
| 484 "../lib", |
| 485 ], |
| 486 [ |
| 487 "core", |
| 488 processed_gypis.core_runtime_sources, |
| 489 "../lib", |
| 490 ], |
| 491 [ |
| 492 "developer", |
| 493 processed_gypis.developer_runtime_sources, |
| 494 "../lib", |
| 495 ], |
| 496 [ |
| 497 "internal", |
| 498 processed_gypis.internal_runtime_sources, |
| 499 "../lib", |
| 500 ], |
| 501 [ |
| 502 "isolate", |
| 503 processed_gypis.isolate_runtime_sources, |
| 504 "../lib", |
| 505 ], |
| 506 [ |
| 507 "math", |
| 508 processed_gypis.math_runtime_sources, |
| 509 "../lib", |
| 510 ], |
| 511 [ |
| 512 "mirrors", |
| 513 processed_gypis.mirrors_runtime_sources, |
| 514 "../lib", |
| 515 ], |
| 516 [ |
| 517 "profiler", |
| 518 processed_gypis.profiler_runtime_sources, |
| 519 "../lib", |
| 520 ], |
| 521 [ |
| 522 "vmservice", |
| 523 processed_gypis.vmservice_runtime_sources, |
| 524 "../lib", |
| 525 ], |
| 526 [ |
| 527 "io", |
| 528 processed_gypis.bin_io_sources, |
| 529 "../bin", |
| 530 ], |
| 531 ] |
| 532 } |
OLD | NEW |