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

Side by Side Diff: utils/dartdevc/BUILD.gn

Issue 2955513002: Dynamically load packages for dartdevc tests in test.dart. (Closed)
Patch Set: Remove TODO that's TODONE. Created 3 years, 5 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 | « tools/testing/dart/utils.dart ('k') | 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("../application_snapshot.gni") 5 import("../application_snapshot.gni")
6 import("../create_timestamp.gni")
6 7
7 application_snapshot("dartdevc") { 8 application_snapshot("dartdevc") {
8 main_dart = "../../pkg/dev_compiler/bin/dartdevc.dart" 9 main_dart = "../../pkg/dev_compiler/bin/dartdevc.dart"
9 training_args = [ 10 training_args = [
10 "--dart-sdk", 11 "--dart-sdk",
11 rebase_path("../../sdk"), 12 rebase_path("../../sdk"),
12 "--dart-sdk-summary", 13 "--dart-sdk-summary",
13 rebase_path("../../pkg/dev_compiler/lib/sdk/ddc_sdk.sum"), 14 rebase_path("../../pkg/dev_compiler/lib/sdk/ddc_sdk.sum"),
14 "--library-root", 15 "--library-root",
15 rebase_path("../../pkg/dev_compiler"), 16 rebase_path("../../pkg/dev_compiler"),
16 "-o", 17 "-o",
17 "dartdevc.js", 18 "dartdevc.js",
18 "--unsafe-force-compile", 19 "--unsafe-force-compile",
19 rebase_path("../../pkg/dev_compiler/bin/dartdevc.dart"), 20 rebase_path("../../pkg/dev_compiler/bin/dartdevc.dart"),
20 ] 21 ]
21 inputs = exec_script("../../tools/list_dart_files.py", 22 inputs = exec_script("../../tools/list_dart_files.py",
22 [ "absolute", 23 [
23 rebase_path("../../pkg/dev_compiler/bin") ], 24 "absolute",
25 rebase_path("../../pkg/dev_compiler/bin"),
26 ],
24 "list lines") 27 "list lines")
25 } 28 }
26 29
27 sdk_lib_files = exec_script( 30 sdk_lib_files = exec_script("../../tools/list_dart_files.py",
28 "../../tools/list_dart_files.py", 31 [
29 [ "absolute", rebase_path("../../sdk/lib") ], 32 "absolute",
30 "list lines") 33 rebase_path("../../sdk/lib"),
34 ],
35 "list lines")
31 36
32 compiler_files = exec_script( 37 compiler_files = exec_script("../../tools/list_dart_files.py",
33 "../../tools/list_dart_files.py", 38 [
34 [ "absolute", rebase_path("../../pkg/compiler") ], 39 "absolute",
35 "list lines") 40 rebase_path("../../pkg/compiler"),
41 ],
42 "list lines")
36 43
37 dev_compiler_files = exec_script( 44 dev_compiler_files = exec_script("../../tools/list_dart_files.py",
38 "../../tools/list_dart_files.py", 45 [
39 [ "absolute", rebase_path("../../pkg/dev_compiler") ], 46 "absolute",
40 "list lines") 47 rebase_path("../../pkg/dev_compiler"),
48 ],
49 "list lines")
41 50
42 template("dart2js_compile") { 51 template("dart2js_compile") {
43 assert(defined(invoker.main), "Must specify the main file") 52 assert(defined(invoker.main), "Must specify the main file")
44 main = invoker.main 53 main = invoker.main
45 assert(defined(invoker.out), "Must specify the out file") 54 assert(defined(invoker.out), "Must specify the out file")
46 out = invoker.out 55 out = invoker.out
47 abs_main = rebase_path(main) 56 abs_main = rebase_path(main)
48 abs_output = rebase_path(out) 57 abs_output = rebase_path(out)
49 58
50 compiled_action(target_name) { 59 compiled_action(target_name) {
51 tool = "../../runtime/bin:dart" 60 tool = "../../runtime/bin:dart"
52 inputs = sdk_lib_files + compiler_files + dev_compiler_files 61 inputs = sdk_lib_files + compiler_files + dev_compiler_files
53 outputs = [ 62 outputs = [
54 out, 63 out,
55 ] 64 ]
56 65
57 dot_packages = rebase_path("../../.packages") 66 dot_packages = rebase_path("../../.packages")
58 compiler = 67 compiler = rebase_path("../../pkg/compiler/lib/src/dart2js.dart")
59 rebase_path("../../pkg/compiler/lib/src/dart2js.dart")
60 68
61 args = [ 69 args = [
62 "--packages=$dot_packages", 70 "--packages=$dot_packages",
63 compiler, 71 compiler,
64 "--packages=$dot_packages", 72 "--packages=$dot_packages",
65 "$abs_main", 73 "$abs_main",
66 "-m", 74 "-m",
67 "-o$abs_output", 75 "-o$abs_output",
68 ] 76 ]
69 } 77 }
70 } 78 }
71 79
72 dart2js_compile("dartdevc_web") { 80 dart2js_compile("dartdevc_web") {
73 main = rebase_path("../../pkg/dev_compiler/web/main.dart") 81 main = rebase_path("../../pkg/dev_compiler/web/main.dart")
74 out = "$root_out_dir/dev_compiler/build/web/ddc_web_compiler.js" 82 out = "$root_out_dir/dev_compiler/build/web/ddc_web_compiler.js"
75 } 83 }
76 84
77 dart2js_compile("stack_trace_mapper") { 85 dart2js_compile("stack_trace_mapper") {
78 main = rebase_path("../../pkg/dev_compiler/web/stack_trace_mapper.dart") 86 main = rebase_path("../../pkg/dev_compiler/web/stack_trace_mapper.dart")
79 out = "$root_out_dir/dev_compiler/build/web/dart_stack_trace_mapper.js" 87 out = "$root_out_dir/dev_compiler/build/web/dart_stack_trace_mapper.js"
80 } 88 }
89
90 # Builds everything needed to run dartdevc tests using test.dart.
91 group("dartdevc_test") {
92 deps = [
93 ":dartdevc",
94 ":dartdevc_test_pkg",
95 "../../sdk:create_sdk",
96 ]
97 }
98
99 create_timestamp_file("dartdevc_files_stamp") {
100 path = rebase_path("../../pkg/dev_compiler/lib")
101 output = "$target_gen_dir/dartdevc_files.stamp"
102 }
103
104 # Compiles the packages used by the tests to JS with dartdevc so that they are
105 # available for loading by the tests.
106 compiled_action("dartdevc_test_pkg") {
107 tool = "../../runtime/bin:dart"
108
109 deps = [
110 ":dartdevc_files_stamp",
111 "../../pkg:pkg_files_stamp",
112 ]
113
114 inputs = [
115 "$target_gen_dir/dartdevc_files.stamp",
116 "$root_gen_dir/pkg_files.stamp",
117 ]
118
119 outputs = [
120 "$target_gen_dir/pkg/async_helper.js",
121 "$target_gen_dir/pkg/async_helper.sum",
122 "$target_gen_dir/pkg/collection.js",
123 "$target_gen_dir/pkg/collection.sum",
124 "$target_gen_dir/pkg/expect.js",
125 "$target_gen_dir/pkg/expect.sum",
126 "$target_gen_dir/pkg/js.js",
127 "$target_gen_dir/pkg/js.sum",
128 "$target_gen_dir/pkg/matcher.js",
129 "$target_gen_dir/pkg/matcher.sum",
130 "$target_gen_dir/pkg/meta.js",
131 "$target_gen_dir/pkg/meta.sum",
132 "$target_gen_dir/pkg/path.js",
133 "$target_gen_dir/pkg/path.sum",
134 "$target_gen_dir/pkg/stack_trace.js",
135 "$target_gen_dir/pkg/stack_trace.sum",
136
137 # TODO(rnystrom): Remove this when unittest is no longer used. Also remove
138 # any of the above packages that are only here because unittest uses them.
139 "$target_gen_dir/pkg/unittest.js",
140 "$target_gen_dir/pkg/unittest.sum",
141 ]
142
143 args = [
144 rebase_path("../../pkg/dev_compiler/tool/build_pkgs.dart"),
145 rebase_path("$target_gen_dir/pkg"),
146 ]
147 }
OLDNEW
« no previous file with comments | « tools/testing/dart/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698