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("../application_snapshot.gni") | 5 import("../application_snapshot.gni") |
6 | 6 |
7 application_snapshot("dartdevc") { | 7 application_snapshot("dartdevc") { |
8 main_dart = "../../pkg/dev_compiler/bin/dartdevc.dart" | 8 main_dart = "../../pkg/dev_compiler/bin/dartdevc.dart" |
9 training_args = [ | 9 training_args = [ |
10 "--dart-sdk", | 10 "--dart-sdk", |
11 rebase_path("../../sdk"), | 11 rebase_path("../../sdk"), |
12 "--dart-sdk-summary", | 12 "--dart-sdk-summary", |
13 rebase_path("../../pkg/dev_compiler/lib/sdk/ddc_sdk.sum"), | 13 rebase_path("../../pkg/dev_compiler/lib/sdk/ddc_sdk.sum"), |
14 "--library-root", | 14 "--library-root", |
15 rebase_path("../../pkg/dev_compiler"), | 15 rebase_path("../../pkg/dev_compiler"), |
16 "-o", | 16 "-o", |
17 "dartdevc.js", | 17 "dartdevc.js", |
18 "--unsafe-force-compile", | 18 "--unsafe-force-compile", |
19 rebase_path("../../pkg/dev_compiler/bin/dartdevc.dart"), | 19 rebase_path("../../pkg/dev_compiler/bin/dartdevc.dart"), |
20 ] | 20 ] |
21 inputs = exec_script("../../tools/list_dart_files.py", | 21 inputs = exec_script("../../tools/list_dart_files.py", |
22 [ "absolute", | 22 [ "absolute", |
23 rebase_path("../../pkg/dev_compiler/bin") ], | 23 rebase_path("../../pkg/dev_compiler/bin") ], |
24 "list lines") | 24 "list lines") |
25 } | 25 } |
| 26 |
| 27 sdk_lib_files = exec_script( |
| 28 "../../tools/list_dart_files.py", |
| 29 [ "absolute", rebase_path("../../sdk/lib") ], |
| 30 "list lines") |
| 31 |
| 32 compiler_files = exec_script( |
| 33 "../../tools/list_dart_files.py", |
| 34 [ "absolute", rebase_path("../../pkg/compiler") ], |
| 35 "list lines") |
| 36 |
| 37 dev_compiler_files = exec_script( |
| 38 "../../tools/list_dart_files.py", |
| 39 [ "absolute", rebase_path("../../pkg/dev_compiler") ], |
| 40 "list lines") |
| 41 |
| 42 template("dart2js_compile") { |
| 43 assert(defined(invoker.main), "Must specify the main file") |
| 44 main = invoker.main |
| 45 assert(defined(invoker.out), "Must specify the out file") |
| 46 out = invoker.out |
| 47 abs_main = rebase_path(main) |
| 48 abs_output = rebase_path(out) |
| 49 |
| 50 compiled_action(target_name) { |
| 51 tool = "../../runtime/bin:dart" |
| 52 inputs = sdk_lib_files + compiler_files + dev_compiler_files |
| 53 outputs = [ |
| 54 out, |
| 55 ] |
| 56 |
| 57 dot_packages = rebase_path("../../.packages") |
| 58 compiler = |
| 59 rebase_path("../../pkg/compiler/lib/src/dart2js.dart") |
| 60 |
| 61 args = [ |
| 62 "--packages=$dot_packages", |
| 63 compiler, |
| 64 "--packages=$dot_packages", |
| 65 "$abs_main", |
| 66 "-m", |
| 67 "-o$abs_output", |
| 68 ] |
| 69 } |
| 70 } |
| 71 |
| 72 dart2js_compile("dartdevc_web") { |
| 73 main = rebase_path("../../pkg/dev_compiler/web/main.dart") |
| 74 out = "$root_out_dir/dev_compiler/build/web/ddc_web_compiler.js" |
| 75 } |
| 76 |
| 77 dart2js_compile("stack_trace_mapper") { |
| 78 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" |
| 80 } |
OLD | NEW |