OLD | NEW |
1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2017, 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 # The SDK for Fuchsia does not include: | 5 declare_args() { |
6 # dart2js | 6 # Build a SDK with less stuff. It excludes dart2js, ddc, web libraries, and |
7 # dartdoc | 7 # analyzer sources. |
8 # ddc | 8 dart_platform_sdk = false |
9 # and libraries that are browser-specific, since these are not used and require | 9 } |
10 # significant time to build. | |
11 # TODO(zra): Assemble the SDK completely with GN, and remove create_sdk.py. | |
12 if (defined(is_fuchsia) && (is_fuchsia || is_fuchsia_host)) { | |
13 template("copy_tree") { | |
14 assert(defined(invoker.source), "copy_tree must define 'source'") | |
15 assert(defined(invoker.dest), "copy_tree must define 'dest'") | |
16 source = invoker.source | |
17 dest = invoker.dest | |
18 action(target_name) { | |
19 deps = [] | |
20 if (defined(invoker.deps)) { | |
21 deps += invoker.deps | |
22 } | |
23 | 10 |
24 common_args = [ | 11 if (is_fuchsia || is_fuchsia_host) { |
25 "--from", | 12 dart_platform_sdk = true |
26 rebase_path(source), | 13 } |
27 "--to", | 14 |
28 rebase_path(dest), | 15 template("copy_tree") { |
| 16 assert(defined(invoker.source), "copy_tree must define 'source'") |
| 17 assert(defined(invoker.dest), "copy_tree must define 'dest'") |
| 18 source = invoker.source |
| 19 dest = invoker.dest |
| 20 action(target_name) { |
| 21 deps = [] |
| 22 if (defined(invoker.deps)) { |
| 23 deps += invoker.deps |
| 24 } |
| 25 |
| 26 common_args = [ |
| 27 "--from", |
| 28 rebase_path(source), |
| 29 "--to", |
| 30 rebase_path(dest), |
| 31 ] |
| 32 if (defined(invoker.exclude)) { |
| 33 common_args += [ |
| 34 "--exclude", |
| 35 invoker.exclude, |
29 ] | 36 ] |
30 if (defined(invoker.exclude)) { | 37 } |
31 common_args += [ | |
32 "--exclude", | |
33 invoker.exclude, | |
34 ] | |
35 } | |
36 | 38 |
37 dry_run_args = common_args + [ "--dry-run" ] | 39 dry_run_args = common_args + [ "--dry-run" ] |
38 input_files = | 40 input_files = |
39 exec_script("../tools/copy_tree.py", dry_run_args, "list lines") | 41 exec_script("../tools/copy_tree.py", dry_run_args, "list lines") |
40 inputs = input_files | 42 inputs = input_files |
41 relative_files = rebase_path(input_files, rebase_path(source)) | 43 relative_files = rebase_path(input_files, rebase_path(source)) |
42 | 44 |
43 output_files = [] | 45 output_files = [] |
44 foreach(input, relative_files) { | 46 foreach(input, relative_files) { |
45 output_files += [ "$dest/$input" ] | 47 output_files += [ "$dest/$input" ] |
46 } | 48 } |
47 | 49 |
48 outputs = output_files | 50 outputs = output_files |
49 script = "../tools/copy_tree.py" | 51 script = "../tools/copy_tree.py" |
50 args = common_args | 52 args = common_args |
51 } | |
52 } | 53 } |
| 54 } |
53 | 55 |
54 copy("copy_dart") { | 56 copy("copy_dart") { |
55 deps = [ | 57 deps = [ |
56 "../runtime/bin:dart", | 58 "../runtime/bin:dart", |
| 59 ] |
| 60 dart_out = get_label_info("../runtime/bin:dart", "root_out_dir") |
| 61 if (is_win) { |
| 62 sources = [ |
| 63 "$dart_out/dart.exe", |
57 ] | 64 ] |
58 dart_out = get_label_info("../runtime/bin:dart", "root_out_dir") | 65 } else if (is_fuchsia || is_fuchsia_host) { |
59 dart_name = get_label_info("../runtime/bin:dart", "name") | |
60 sources = [ | 66 sources = [ |
61 "$dart_out/$dart_name", | 67 "$dart_out/dart", |
62 ] | 68 ] |
63 outputs = [ | 69 } else { |
64 "$root_out_dir/dart-sdk/bin/dart", | 70 sources = [ |
| 71 "$dart_out/exe.stripped/dart", |
65 ] | 72 ] |
66 } | 73 } |
| 74 if (is_win) { |
| 75 sources += [ "$dart_out/dart.lib" ] |
| 76 } |
| 77 outputs = [ |
| 78 "$root_out_dir/dart-sdk/bin/{{source_file_part}}", |
| 79 ] |
| 80 } |
67 | 81 |
| 82 if (is_fuchsia_host && is_linux) { |
68 copy("copy_dylibs") { | 83 copy("copy_dylibs") { |
69 deps = [ | 84 deps = [ |
70 "//third_party/boringssl:crypto", | 85 "//third_party/boringssl:crypto", |
71 "//third_party/boringssl:ssl", | 86 "//third_party/boringssl:ssl", |
72 ] | 87 ] |
73 crypto_out = | 88 crypto_out = |
74 get_label_info("//third_party/boringssl:crypto", "root_out_dir") | 89 get_label_info("//third_party/boringssl:crypto", "root_out_dir") |
75 crypto_name = get_label_info("//third_party/boringssl:crypto", "name") | 90 crypto_name = get_label_info("//third_party/boringssl:crypto", "name") |
76 ssl_out = get_label_info("//third_party/boringssl:ssl", "root_out_dir") | 91 ssl_out = get_label_info("//third_party/boringssl:ssl", "root_out_dir") |
77 ssl_name = get_label_info("//third_party/boringssl:ssl", "name") | 92 ssl_name = get_label_info("//third_party/boringssl:ssl", "name") |
78 sources = [ | 93 sources = [ |
79 "$crypto_out/lib${crypto_name}.so", | 94 "$crypto_out/lib${crypto_name}.so", |
80 "$ssl_out/lib${ssl_name}.so", | 95 "$ssl_out/lib${ssl_name}.so", |
81 ] | 96 ] |
82 outputs = [ | 97 outputs = [ |
83 "$root_out_dir/dart-sdk/bin/{{source_file_part}}", | 98 "$root_out_dir/dart-sdk/bin/{{source_file_part}}", |
84 ] | 99 ] |
85 } | 100 } |
86 | 101 } |
87 template("copy_sdk_script") { | 102 |
88 assert(defined(invoker.name), "copy_sdk_script must define 'name'") | 103 template("copy_sdk_script") { |
89 name = invoker.name | 104 assert(defined(invoker.name), "copy_sdk_script must define 'name'") |
90 copy(target_name) { | 105 name = invoker.name |
91 sources = [ | 106 ext = "" |
92 "bin/${name}_sdk", | 107 if (is_win) { |
93 ] | 108 ext = ".bat" |
94 outputs = [ | 109 } |
95 "$root_out_dir/dart-sdk/bin/${name}", | 110 copy(target_name) { |
96 ] | 111 sources = [ |
| 112 "bin/${name}_sdk$ext", |
| 113 ] |
| 114 outputs = [ |
| 115 "$root_out_dir/dart-sdk/bin/$name$ext", |
| 116 ] |
| 117 } |
| 118 } |
| 119 |
| 120 _sdk_scripts = [ |
| 121 "dartanalyzer", |
| 122 "dartfmt", |
| 123 "pub", |
| 124 ] |
| 125 |
| 126 if (!dart_platform_sdk) { |
| 127 _sdk_scripts += [ |
| 128 "dart2js", |
| 129 "dartdevc", |
| 130 ] |
| 131 } |
| 132 |
| 133 foreach(sdk_script, _sdk_scripts) { |
| 134 copy_sdk_script("copy_${sdk_script}_script") { |
| 135 name = sdk_script |
| 136 } |
| 137 } |
| 138 |
| 139 _scripts = [ "dartdoc" ] |
| 140 |
| 141 foreach(script, _scripts) { |
| 142 copy("copy_${script}_script") { |
| 143 ext = "" |
| 144 if (is_win) { |
| 145 ext = ".bat" |
97 } | 146 } |
98 } | 147 sources = [ |
99 | 148 "bin/$script$ext", |
100 _sdk_scripts = [ | 149 ] |
| 150 outputs = [ |
| 151 "$root_out_dir/dart-sdk/bin/{{source_file_part}}", |
| 152 ] |
| 153 } |
| 154 } |
| 155 |
| 156 group("copy_scripts") { |
| 157 deps = [] |
| 158 foreach(sdk_script, _sdk_scripts) { |
| 159 deps += [ ":copy_${sdk_script}_script" ] |
| 160 } |
| 161 foreach(script, _scripts) { |
| 162 deps += [ ":copy_${script}_script" ] |
| 163 } |
| 164 } |
| 165 |
| 166 _snapshots = [ |
| 167 [ |
| 168 "analysis_server", |
| 169 "../utils/analysis_server", |
| 170 ], |
| 171 [ |
101 "dartanalyzer", | 172 "dartanalyzer", |
| 173 "../utils/dartanalyzer:generate_dartanalyzer_snapshot", |
| 174 ], |
| 175 [ |
| 176 "dartdoc", |
| 177 "../utils/dartdoc", |
| 178 ], |
| 179 [ |
102 "dartfmt", | 180 "dartfmt", |
| 181 "../utils/dartfmt", |
| 182 ], |
| 183 [ |
103 "pub", | 184 "pub", |
104 ] | 185 "../utils/pub", |
105 | 186 ], |
106 foreach(sdk_script, _sdk_scripts) { | 187 ] |
107 copy_sdk_script("copy_${sdk_script}_script") { | 188 |
108 name = sdk_script | 189 if (!dart_platform_sdk) { |
109 } | 190 _snapshots += [ |
110 } | |
111 | |
112 group("copy_scripts") { | |
113 deps = [ | |
114 ":copy_dartanalyzer_script", | |
115 ":copy_dartfmt_script", | |
116 ":copy_pub_script", | |
117 ] | |
118 } | |
119 | |
120 _snapshots = [ | |
121 [ | 191 [ |
122 "analysis_server", | 192 "dart2js", |
123 "../utils/analysis_server", | 193 "../utils/compiler:dart2js", |
124 ], | 194 ], |
125 [ | 195 [ |
126 "dartanalyzer", | 196 "utils_wrapper", |
127 "../utils/dartanalyzer:generate_dartanalyzer_snapshot", | 197 "../utils/compiler:utils_wrapper", |
128 ], | 198 ], |
129 [ | 199 [ |
130 "dartfmt", | 200 "dartdevc", |
131 "../utils/dartfmt", | 201 "../utils/dartdevc", |
132 ], | 202 ], |
133 [ | 203 ] |
134 "pub", | 204 } |
135 "../utils/pub", | 205 |
136 ], | 206 foreach(snapshot, _snapshots) { |
137 ] | 207 copy("copy_${snapshot[0]}_snapshot") { |
138 | 208 deps = [ |
| 209 snapshot[1], |
| 210 ] |
| 211 sources = [ |
| 212 "$root_gen_dir/${snapshot[0]}.dart.snapshot", |
| 213 ] |
| 214 outputs = [ |
| 215 "$root_out_dir/dart-sdk/bin/snapshots/{{source_file_part}}", |
| 216 ] |
| 217 } |
| 218 } |
| 219 |
| 220 group("copy_snapshots") { |
| 221 deps = [] |
139 foreach(snapshot, _snapshots) { | 222 foreach(snapshot, _snapshots) { |
140 copy("copy_${snapshot[0]}_snapshot") { | 223 deps += [ ":copy_${snapshot[0]}_snapshot" ] |
141 deps = [ | 224 } |
142 snapshot[1], | 225 } |
143 ] | 226 |
144 sources = [ | 227 # Copy analyzer sources |
145 "$root_gen_dir/${snapshot[0]}.dart.snapshot", | 228 _analyzer_source_dirs = [] |
146 ] | 229 if (!dart_platform_sdk) { |
147 outputs = [ | 230 _analyzer_source_dirs += [ |
148 "$root_out_dir/dart-sdk/bin/snapshots/{{source_file_part}}", | 231 "analyzer", |
149 ] | 232 "analysis_server", |
150 } | 233 "front_end", |
151 } | 234 "kernel", |
152 | 235 ] |
153 group("copy_snapshots") { | 236 } |
154 deps = [ | 237 |
155 ":copy_analysis_server_snapshot", | 238 foreach(analyzer_source_dir, _analyzer_source_dirs) { |
156 ":copy_dartanalyzer_snapshot", | 239 copy_tree("copy_${analyzer_source_dir}_source_dir") { |
157 ":copy_dartfmt_snapshot", | 240 source = "../pkg/$analyzer_source_dir" |
158 ":copy_pub_snapshot", | 241 dest = "$root_out_dir/dart-sdk/lib/$analyzer_source_dir" |
159 ] | 242 exclude = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore,packages" |
160 } | 243 } |
161 | 244 } |
162 copy("copy_analysis_summaries") { | 245 |
| 246 group("copy_analyzer_sources") { |
| 247 deps = [] |
| 248 foreach(analyzer_source_dir, _analyzer_source_dirs) { |
| 249 deps += [ ":copy_${analyzer_source_dir}_source_dir" ] |
| 250 } |
| 251 } |
| 252 |
| 253 copy_tree("copy_dartdoc_templates") { |
| 254 source = "../third_party/pkg/dartdoc/lib/templates" |
| 255 dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/templates" |
| 256 } |
| 257 |
| 258 copy_tree("copy_dartdoc_resources") { |
| 259 source = "../third_party/pkg/dartdoc/lib/resources" |
| 260 dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/resources" |
| 261 } |
| 262 |
| 263 write_file("$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/.packages", |
| 264 "dartdoc:.") |
| 265 |
| 266 group("copy_dartdoc_files") { |
| 267 deps = [ |
| 268 ":copy_dartdoc_resources", |
| 269 ":copy_dartdoc_templates", |
| 270 ] |
| 271 } |
| 272 |
| 273 copy("copy_analysis_summaries") { |
| 274 deps = [ |
| 275 ":copy_libraries", |
| 276 "../utils/dartanalyzer:generate_summary_spec", |
| 277 "../utils/dartanalyzer:generate_summary_strong", |
| 278 ] |
| 279 sources = [ |
| 280 "$root_gen_dir/spec.sum", |
| 281 "$root_gen_dir/strong.sum", |
| 282 ] |
| 283 outputs = [ |
| 284 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", |
| 285 ] |
| 286 } |
| 287 |
| 288 if (!dart_platform_sdk) { |
| 289 copy("copy_dev_compiler_summary") { |
163 deps = [ | 290 deps = [ |
164 ":copy_libraries", | 291 ":copy_libraries", |
165 "../utils/dartanalyzer:generate_summary_spec", | |
166 "../utils/dartanalyzer:generate_summary_strong", | |
167 ] | 292 ] |
168 sources = [ | 293 sources = [ |
169 "$root_gen_dir/spec.sum", | 294 "../pkg/dev_compiler/lib/sdk/ddc_sdk.sum", |
170 "$root_gen_dir/strong.sum", | |
171 ] | 295 ] |
172 outputs = [ | 296 outputs = [ |
173 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", | 297 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", |
174 ] | 298 ] |
175 } | 299 } |
176 | 300 |
177 copy("copy_headers") { | 301 copy_tree("copy_dev_compiler_js") { |
| 302 source = "../pkg/dev_compiler/lib/js" |
| 303 dest = "$root_out_dir/dart-sdk/lib/dev_compiler" |
| 304 } |
| 305 |
| 306 copy("copy_dev_compiler_require_js") { |
| 307 deps = [ |
| 308 ":copy_dev_compiler_js", |
| 309 ] |
178 sources = [ | 310 sources = [ |
179 "../runtime/include/dart_api.h", | 311 "../third_party/requirejs/require.js", |
180 "../runtime/include/dart_mirrors_api.h", | |
181 "../runtime/include/dart_native_api.h", | |
182 "../runtime/include/dart_tools_api.h", | |
183 ] | 312 ] |
184 outputs = [ | 313 outputs = [ |
185 "$root_out_dir/dart-sdk/include/{{source_file_part}}", | 314 "$root_out_dir/dart-sdk/lib/dev_compiler/amd/{{source_file_part}}", |
186 ] | 315 ] |
187 } | 316 } |
188 | 317 |
189 copy("copy_platform_files") { | 318 group("copy_dev_compiler_sdk") { |
190 sources = [ | 319 deps = [ |
191 "lib/dart_client.platform", | 320 ":copy_dev_compiler_js", |
192 "lib/dart_server.platform", | 321 ":copy_dev_compiler_require_js", |
193 "lib/dart_shared.platform", | 322 ":copy_dev_compiler_summary", |
194 ] | 323 ] |
195 outputs = [ | 324 } |
196 "$root_out_dir/dart-sdk/lib/{{source_file_part}}", | 325 } |
197 ] | 326 |
198 } | 327 copy("copy_headers") { |
199 | 328 sources = [ |
200 copy_tree("copy_pub_assets") { | 329 "../runtime/include/dart_api.h", |
| 330 "../runtime/include/dart_mirrors_api.h", |
| 331 "../runtime/include/dart_native_api.h", |
| 332 "../runtime/include/dart_tools_api.h", |
| 333 ] |
| 334 outputs = [ |
| 335 "$root_out_dir/dart-sdk/include/{{source_file_part}}", |
| 336 ] |
| 337 } |
| 338 |
| 339 copy("copy_platform_files") { |
| 340 sources = [ |
| 341 "lib/dart_client.platform", |
| 342 "lib/dart_server.platform", |
| 343 "lib/dart_shared.platform", |
| 344 ] |
| 345 outputs = [ |
| 346 "$root_out_dir/dart-sdk/lib/{{source_file_part}}", |
| 347 ] |
| 348 } |
| 349 |
| 350 copy_tree("copy_pub_assets") { |
| 351 deps = [ |
| 352 ":copy_libraries", |
| 353 ] |
| 354 source = "../third_party/pkg/pub/lib/src/asset" |
| 355 dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset" |
| 356 } |
| 357 |
| 358 _libraries = [ |
| 359 "_internal", |
| 360 "async", |
| 361 "collection", |
| 362 "convert", |
| 363 "core", |
| 364 "developer", |
| 365 "internal", |
| 366 "io", |
| 367 "isolate", |
| 368 "math", |
| 369 "mirrors", |
| 370 "profiler", |
| 371 "typed_data", |
| 372 ] |
| 373 |
| 374 if (!dart_platform_sdk) { |
| 375 _libraries += [ |
| 376 "_blink", |
| 377 "_chrome", |
| 378 "html", |
| 379 "indexed_db", |
| 380 "js", |
| 381 "js_util", |
| 382 "svg", |
| 383 "web_audio", |
| 384 "web_gl", |
| 385 "web_sql", |
| 386 ] |
| 387 } |
| 388 |
| 389 foreach(library, _libraries) { |
| 390 copy_tree("copy_${library}_library") { |
| 391 source = "lib/$library" |
| 392 dest = "$root_out_dir/dart-sdk/lib/$library" |
| 393 exclude = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore" |
| 394 } |
| 395 } |
| 396 |
| 397 group("copy_libraries") { |
| 398 deps = [] |
| 399 foreach(library, _libraries) { |
| 400 deps += [ ":copy_${library}_library" ] |
| 401 } |
| 402 } |
| 403 |
| 404 if (is_win) { |
| 405 copy_tree("copy_7zip") { |
201 deps = [ | 406 deps = [ |
202 ":copy_libraries", | 407 ":copy_libraries", |
203 ] | |
204 source = "../third_party/pkg/pub/lib/src/asset" | |
205 dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset" | |
206 } | |
207 | |
208 _libraries = [ | |
209 "_internal", | |
210 "async", | |
211 "collection", | |
212 "convert", | |
213 "core", | |
214 "developer", | |
215 "internal", | |
216 "io", | |
217 "isolate", | |
218 "math", | |
219 "mirrors", | |
220 "profiler", | |
221 "typed_data", | |
222 ] | |
223 | |
224 foreach(library, _libraries) { | |
225 copy_tree("copy_${library}_library") { | |
226 source = "lib/$library" | |
227 dest = "$root_out_dir/dart-sdk/lib/$library" | |
228 exclude = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore" | |
229 } | |
230 } | |
231 | |
232 group("copy_libraries") { | |
233 deps = [ | |
234 ":copy__internal_library", | |
235 ":copy_async_library", | |
236 ":copy_collection_library", | |
237 ":copy_convert_library", | |
238 ":copy_core_library", | |
239 ":copy_developer_library", | |
240 ":copy_internal_library", | |
241 ":copy_io_library", | |
242 ":copy_isolate_library", | |
243 ":copy_math_library", | |
244 ":copy_mirrors_library", | |
245 ":copy_profiler_library", | |
246 ":copy_typed_data_library", | |
247 ] | |
248 } | |
249 | |
250 action("write_version_file") { | |
251 output = "$root_out_dir/dart-sdk/version" | |
252 outputs = [ | |
253 output, | |
254 ] | |
255 script = "../tools/write_version_file.py" | |
256 args = [ | |
257 "--output", | |
258 rebase_path(output), | |
259 ] | |
260 } | |
261 | |
262 action("write_revision_file") { | |
263 output = "$root_out_dir/dart-sdk/revision" | |
264 outputs = [ | |
265 output, | |
266 ] | |
267 script = "../tools/write_revision_file.py" | |
268 args = [ | |
269 "--output", | |
270 rebase_path(output), | |
271 ] | |
272 } | |
273 | |
274 copy("copy_readme") { | |
275 sources = [ | |
276 "../README.dart-sdk", | |
277 ] | |
278 outputs = [ | |
279 "$root_out_dir/dart-sdk/README", | |
280 ] | |
281 } | |
282 | |
283 copy("copy_license") { | |
284 sources = [ | |
285 "../LICENSE", | |
286 ] | |
287 outputs = [ | |
288 "$root_out_dir/dart-sdk/LICENSE", | |
289 ] | |
290 } | |
291 | |
292 copy("copy_api_readme") { | |
293 sources = [ | |
294 "api_readme.md", | |
295 ] | |
296 outputs = [ | |
297 "$root_out_dir/dart-sdk/lib/api_readme.md", | |
298 ] | |
299 } | |
300 | |
301 group("create_sdk") { | |
302 deps = [ | |
303 ":copy_analysis_summaries", | |
304 ":copy_api_readme", | |
305 ":copy_dart", | |
306 ":copy_headers", | |
307 ":copy_libraries", | |
308 ":copy_license", | |
309 ":copy_platform_files", | |
310 ":copy_pub_assets", | 408 ":copy_pub_assets", |
311 ":copy_readme", | 409 ] |
312 ":copy_scripts", | 410 source = "../third_party/7zip" |
313 ":copy_snapshots", | 411 dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset/7zip" |
314 ":write_revision_file", | 412 } |
315 ":write_version_file", | 413 } |
316 ] | 414 |
317 if (is_fuchsia_host && is_linux) { | 415 action("write_version_file") { |
318 deps += [ ":copy_dylibs" ] | 416 output = "$root_out_dir/dart-sdk/version" |
319 } | 417 outputs = [ |
320 } | 418 output, |
321 } else { | 419 ] |
322 action("create_sdk") { | 420 script = "../tools/write_version_file.py" |
323 deps = [ | 421 args = [ |
324 "../runtime/bin:dart", | 422 "--output", |
325 "../utils/analysis_server", | 423 rebase_path(output), |
326 "../utils/compiler:dart2js", | 424 ] |
327 "../utils/compiler:utils_wrapper", | 425 } |
328 "../utils/dartanalyzer:generate_dartanalyzer_snapshot", | 426 |
329 "../utils/dartanalyzer:generate_summary_spec", | 427 action("write_revision_file") { |
330 "../utils/dartanalyzer:generate_summary_strong", | 428 output = "$root_out_dir/dart-sdk/revision" |
331 "../utils/dartdevc", | 429 outputs = [ |
332 "../utils/dartdoc", | 430 output, |
333 "../utils/dartfmt", | 431 ] |
334 "../utils/pub", | 432 script = "../tools/write_revision_file.py" |
335 ] | 433 args = [ |
336 | 434 "--output", |
337 sdk_lib_files = exec_script("../tools/list_dart_files.py", | 435 rebase_path(output), |
338 [ | 436 ] |
339 "absolute", | 437 } |
340 rebase_path("lib"), | 438 |
341 ], | 439 # Copy libraries.dart to lib/_internal/libraries.dart for backwards |
342 "list lines") | 440 # compatibility. |
343 | 441 # |
344 preamble_files = | 442 # TODO(sigmund): stop copying libraries.dart. Old versions (<=0.25.1-alpha.4) |
345 exec_script("../tools/list_files.py", | 443 # of the analyzer package do not support the new location of this file. We |
346 [ | 444 # should be able to remove the old file once we release a newer version of |
347 "absolute", | 445 # analyzer and popular frameworks have migrated to use it. |
348 "", | 446 copy("copy_libraries_dart") { |
349 rebase_path("lib/_internal/js_runtime/lib/preambles"), | 447 deps = [ |
350 ], | 448 ":copy_libraries", |
351 "list lines") | 449 ] |
352 | 450 sources = [ |
353 sdk_bin_files = exec_script("../tools/list_files.py", | 451 "lib/_internal/sdk_library_metadata/lib/libraries.dart", |
354 [ | 452 ] |
355 "absolute", | 453 outputs = [ |
356 "", | 454 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", |
357 rebase_path("bin"), | 455 ] |
358 ], | 456 } |
359 "list lines") | 457 |
360 | 458 copy("copy_readme") { |
361 inputs = sdk_lib_files + preamble_files + sdk_bin_files + [ | 459 sources = [ |
362 "lib/dart_client.platform", | 460 "../README.dart-sdk", |
363 "lib/dart_server.platform", | 461 ] |
364 "lib/dart_shared.platform", | 462 outputs = [ |
365 "$root_gen_dir/dart2js.dart.snapshot", | 463 "$root_out_dir/dart-sdk/README", |
366 "$root_gen_dir/utils_wrapper.dart.snapshot", | 464 ] |
367 "$root_gen_dir/pub.dart.snapshot", | 465 } |
368 "$root_gen_dir/dartanalyzer.dart.snapshot", | 466 |
369 "$root_gen_dir/dartdevc.dart.snapshot", | 467 copy("copy_license") { |
370 "$root_gen_dir/dartfmt.dart.snapshot", | 468 sources = [ |
371 "$root_gen_dir/analysis_server.dart.snapshot", | 469 "../LICENSE", |
372 "$root_gen_dir/dartdoc.dart.snapshot", | 470 ] |
373 "$root_gen_dir/spec.sum", | 471 outputs = [ |
374 "$root_gen_dir/strong.sum", | 472 "$root_out_dir/dart-sdk/LICENSE", |
375 "../tools/VERSION", | 473 ] |
376 ] | 474 } |
377 | 475 |
378 outputs = [ | 476 copy("copy_api_readme") { |
379 "$root_out_dir/dart-sdk/README", | 477 sources = [ |
380 ] | 478 "api_readme.md", |
381 | 479 ] |
382 script = "../tools/create_sdk.py" | 480 outputs = [ |
383 args = [ | 481 "$root_out_dir/dart-sdk/lib/api_readme.md", |
384 "--sdk_output_dir", | 482 ] |
385 rebase_path("$root_out_dir/dart-sdk"), | 483 } |
386 "--snapshot_location", | 484 |
387 rebase_path("$root_gen_dir"), | 485 group("create_sdk") { |
388 ] | 486 deps = [ |
389 } | 487 ":copy_analysis_summaries", |
390 } | 488 ":copy_analyzer_sources", |
| 489 ":copy_api_readme", |
| 490 ":copy_dart", |
| 491 ":copy_dartdoc_files", |
| 492 ":copy_headers", |
| 493 ":copy_libraries", |
| 494 ":copy_libraries_dart", |
| 495 ":copy_license", |
| 496 ":copy_platform_files", |
| 497 ":copy_pub_assets", |
| 498 ":copy_readme", |
| 499 ":copy_scripts", |
| 500 ":copy_snapshots", |
| 501 ":write_revision_file", |
| 502 ":write_version_file", |
| 503 ] |
| 504 if (!dart_platform_sdk) { |
| 505 deps += [ ":copy_dev_compiler_sdk" ] |
| 506 } |
| 507 if (is_win) { |
| 508 deps += [ ":copy_7zip" ] |
| 509 } |
| 510 if (is_fuchsia_host && is_linux) { |
| 511 deps += [ ":copy_dylibs" ] |
| 512 } |
| 513 } |
OLD | NEW |