OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Generates native and HTML/JS supporting code for Web UI element from element's | 5 # Generates native and HTML/JS supporting code for Web UI element from element's |
6 # declaration JSON file. | 6 # declaration JSON file. |
7 # | 7 # |
8 # Parameters: | 8 # Parameters: |
9 # | 9 # |
10 # source (required) | 10 # source (required) |
(...skipping 23 matching lines...) Expand all Loading... |
34 src_root = rebase_path("//", root_build_dir) | 34 src_root = rebase_path("//", root_build_dir) |
35 | 35 |
36 helper_path = "$generator_dir/build_helper.py" | 36 helper_path = "$generator_dir/build_helper.py" |
37 target_name = "${target_name}" | 37 target_name = "${target_name}" |
38 action_name = target_name + "_gen" | 38 action_name = target_name + "_gen" |
39 out_dir = "$root_gen_dir/wug" | 39 out_dir = "$root_gen_dir/wug" |
40 | 40 |
41 helper_args = [ | 41 helper_args = [ |
42 rebase_path(declaration_path, root_build_dir), | 42 rebase_path(declaration_path, root_build_dir), |
43 "--destination", | 43 "--destination", |
44 out_dir, | 44 rebase_path(out_dir, root_build_dir), |
45 "--root", | 45 "--root", |
46 src_root, | 46 src_root, |
47 "--gn", | 47 "--gn", |
48 "--output", | 48 "--output", |
49 ] | 49 ] |
50 | 50 |
51 expected_target_name = | 51 expected_target_name = |
52 exec_script(helper_path, helper_args + [ "target_name" ], "trim string") | 52 exec_script(helper_path, helper_args + [ "target_name" ], "trim string") |
53 assert(target_name == expected_target_name, | 53 assert(target_name == expected_target_name, |
54 "Wrong target name. " + "Expected '" + expected_target_name + | 54 "Wrong target name. " + "Expected '" + expected_target_name + |
(...skipping 23 matching lines...) Expand all Loading... |
78 common_prefix + "view_model.h", | 78 common_prefix + "view_model.h", |
79 common_prefix + "view_model.cc", | 79 common_prefix + "view_model.cc", |
80 common_prefix + "web_ui_view.h", | 80 common_prefix + "web_ui_view.h", |
81 common_prefix + "web_ui_view.cc", | 81 common_prefix + "web_ui_view.cc", |
82 ] | 82 ] |
83 args = [ | 83 args = [ |
84 rebase_path(declaration_path, root_build_dir), | 84 rebase_path(declaration_path, root_build_dir), |
85 "--root", | 85 "--root", |
86 src_root, | 86 src_root, |
87 "--destination", | 87 "--destination", |
88 out_dir, | 88 rebase_path(out_dir, root_build_dir), |
89 ] | 89 ] |
90 } | 90 } |
91 | 91 |
92 component(target_name) { | 92 component(target_name) { |
93 sources = get_target_outputs(":$action_name") | 93 sources = get_target_outputs(":$action_name") |
94 defines = [ exec_script(helper_path, | 94 defines = [ exec_script(helper_path, |
95 helper_args + [ "impl_macro" ], | 95 helper_args + [ "impl_macro" ], |
96 "trim string") ] | 96 "trim string") ] |
97 deps = [ | 97 deps = [ |
98 "//base", | 98 "//base", |
99 "//components/login", | 99 "//components/login", |
100 "//components/strings", | 100 "//components/strings", |
101 ] | 101 ] |
102 deps += exec_script(helper_path, | 102 deps += exec_script(helper_path, |
103 helper_args + [ "import_dependencies" ], | 103 helper_args + [ "import_dependencies" ], |
104 "list lines") | 104 "list lines") |
105 public_deps = [ | 105 public_deps = [ |
106 "//components/webui_generator", | 106 "//components/webui_generator", |
107 ] | 107 ] |
108 | 108 |
109 all_dependent_configs = | 109 all_dependent_configs = |
110 [ "//components/webui_generator:wug_generated_config" ] | 110 [ "//components/webui_generator:wug_generated_config" ] |
111 } | 111 } |
112 } | 112 } |
OLD | NEW |