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

Side by Side Diff: utils/invoke_dart.gni

Issue 2379803002: Linux create_sdk GN build for host (Closed)
Patch Set: Remove debug print Created 4 years, 2 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
OLDNEW
(Empty)
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
3 # BSD-style license that can be found in the LICENSE file.
4
5 template("invoke_dart") {
6 assert(defined(invoker.outputs), "invoke_dart must specify outputs")
7 assert(defined(invoker.dart_root), "Where is the dart root?")
8 dart_root = invoker.dart_root
Cutch 2016/09/29 16:41:26 can't we automatically detect the dart root from t
zra 2016/09/29 17:46:41 Done.
9 extra_deps = []
10 if (defined(invoker.deps)) {
11 extra_deps += invoker.deps
12 }
13
14 extra_inputs = []
15 if (defined(invoker.inputs)) {
16 extra_inputs += invoker.inputs
17 }
18
19 extra_args = []
20 if (defined(invoker.args)) {
21 extra_args += invoker.args
22 }
23
24 action(target_name) {
25 deps = extra_deps + [
26 "$dart_root/runtime/bin:dart($host_toolchain)",
27 ]
28
29 dart_out_dir = get_label_info(
30 "$dart_root/runtime/bin:dart($host_toolchain)", "root_out_dir")
31 # TODO(zra): Add platform specific executable suffix (e.g. .exe on win)
32 dart = rebase_path("$dart_out_dir/dart")
33
34 inputs = [
35 dart,
36 ] + extra_inputs
37
38 outputs = invoker.outputs
39
40 script = "$dart_root/tools/dart_for_gn.py"
41 args = [
42 dart,
43 ] + extra_args
44 }
45 }
46
47 template("application_snapshot") {
48 assert(defined(invoker.dart_root), "Must specify 'dart_root'")
49 assert(defined(invoker.main_dart), "Must specify 'main_dart'")
50 main_dart = invoker.main_dart
51 name = target_name
52 if (defined(invoker.name)) {
53 name = invoker.name
54 }
55 extra_deps = []
56 if (defined(invoker.deps)) {
57 extra_deps += invoker.deps
58 }
59 extra_inputs = []
60 if (defined(invoker.inputs)) {
61 extra_inputs += invoker.inputs
62 }
63 invoke_dart(target_name) {
64 dart_root = invoker.dart_root
65 deps = extra_deps + [
66 "$dart_root/pkg:pkg_files_stamp"
67 ]
68
69 inputs = extra_inputs + [
70 "$dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart",
71 "$root_gen_dir/pkg_files.stamp",
72 ]
73
74 output = "$root_gen_dir/$name.dart.snapshot"
75 outputs = [
76 output,
77 ]
78
79 dot_packages = rebase_path("$dart_root/.packages")
80 abs_output = rebase_path(output)
81 main_file = rebase_path(main_dart)
82
83 args = [
84 "--packages=$dot_packages",
85 "--snapshot=$abs_output",
86 main_file
87 ]
88 }
89 }
OLDNEW
« pkg/BUILD.gn ('K') | « utils/dartfmt/BUILD.gn ('k') | utils/pub/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698