Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: utils/application_snapshot.gni

Issue 2995053002: Allow caller of application_snapshot to override .packages (Closed)
Patch Set: Group arg logic together Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698