| OLD | NEW |
| 1 # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2016, 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/compiled_action.gni") | 5 import("../build/compiled_action.gni") |
| 6 | 6 |
| 7 _dart_root = get_path_info("..", "abspath") | 7 _dart_root = get_path_info("..", "abspath") |
| 8 | 8 |
| 9 declare_args() { | 9 declare_args() { |
| 10 # Default to building app-jit snapshots. The simulator and cross builds | 10 # Default to building app-jit snapshots. The simulator and cross builds |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 name = invoker.name | 25 name = invoker.name |
| 26 } | 26 } |
| 27 extra_deps = [] | 27 extra_deps = [] |
| 28 if (defined(invoker.deps)) { | 28 if (defined(invoker.deps)) { |
| 29 extra_deps += invoker.deps | 29 extra_deps += invoker.deps |
| 30 } | 30 } |
| 31 extra_inputs = [ main_dart ] | 31 extra_inputs = [ main_dart ] |
| 32 if (defined(invoker.inputs)) { | 32 if (defined(invoker.inputs)) { |
| 33 extra_inputs += invoker.inputs | 33 extra_inputs += invoker.inputs |
| 34 } | 34 } |
| 35 if (defined(invoker.dot_packages)) { |
| 36 dot_packages = invoker.dot_packages |
| 37 } else { |
| 38 dot_packages = rebase_path("$_dart_root/.packages") |
| 39 } |
| 35 compiled_action(target_name) { | 40 compiled_action(target_name) { |
| 36 tool = "$_dart_root/runtime/bin:dart" | 41 tool = "$_dart_root/runtime/bin:dart" |
| 37 deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ] | 42 deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ] |
| 38 | 43 |
| 39 inputs = extra_inputs + [ | 44 inputs = extra_inputs + [ |
| 40 "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries
.dart", | 45 "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries
.dart", |
| 41 "$root_gen_dir/pkg_files.stamp", | 46 "$root_gen_dir/pkg_files.stamp", |
| 42 ] | 47 ] |
| 43 | 48 |
| 44 output = "$root_gen_dir/$name.dart.snapshot" | 49 output = "$root_gen_dir/$name.dart.snapshot" |
| 45 outputs = [ | 50 outputs = [ |
| 46 output, | 51 output, |
| 47 ] | 52 ] |
| 48 | 53 |
| 49 dot_packages = rebase_path("$_dart_root/.packages") | |
| 50 abs_output = rebase_path(output) | 54 abs_output = rebase_path(output) |
| 51 main_file = rebase_path(main_dart) | 55 main_file = rebase_path(main_dart) |
| 52 | 56 |
| 53 args = [ | 57 args = [ |
| 54 "--packages=$dot_packages", | 58 "--packages=$dot_packages", |
| 55 "--snapshot=$abs_output", | 59 "--snapshot=$abs_output", |
| 56 ] | 60 ] |
| 57 | 61 |
| 58 if (dart_snapshot_kind == "script") { | 62 if (dart_snapshot_kind == "script") { |
| 59 args += [ | 63 args += [ |
| 60 "--snapshot-kind=script", | 64 "--snapshot-kind=script", |
| 61 main_file, | 65 main_file, |
| 62 ] | 66 ] |
| 63 assert(training_args != "", "Ignoring unused argument") | 67 assert(training_args != "", "Ignoring unused argument") |
| 64 } else if (dart_snapshot_kind == "app-jit") { | 68 } else if (dart_snapshot_kind == "app-jit") { |
| 65 args += [ | 69 args += [ |
| 66 "--snapshot-kind=app-jit", | 70 "--snapshot-kind=app-jit", |
| 67 main_file, | 71 main_file, |
| 68 ] + training_args | 72 ] + training_args |
| 69 } else { | 73 } else { |
| 70 assert(false, "Bad dart_snapshot_kind: $dart_snapshot_kind") | 74 assert(false, "Bad dart_snapshot_kind: $dart_snapshot_kind") |
| 71 } | 75 } |
| 72 } | 76 } |
| 73 } | 77 } |
| OLD | NEW |