| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//tools/grit/grit_rule.gni") | 5 import("//tools/grit/grit_rule.gni") |
| 6 | 6 |
| 7 # See also remoting_locales_with_underscores below. | 7 # See also remoting_locales_with_underscores below. |
| 8 remoting_locales = [ | 8 remoting_locales = [ |
| 9 "am", | 9 "am", |
| 10 "ar", | 10 "ar", |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 "en_GB", | 78 "en_GB", |
| 79 "es_419", | 79 "es_419", |
| 80 "fake_bidi", | 80 "fake_bidi", |
| 81 "pt_BR", | 81 "pt_BR", |
| 82 "pt_PT", | 82 "pt_PT", |
| 83 "zh_CN", | 83 "zh_CN", |
| 84 "zh_TW", | 84 "zh_TW", |
| 85 ] | 85 ] |
| 86 | 86 |
| 87 if (is_chromeos) { | 87 if (is_chromeos) { |
| 88 remoting_locales += ["en-US"] | 88 remoting_locales += [ "en-US" ] |
| 89 remoting_locales_with_underscores += ["en_US"] | 89 remoting_locales_with_underscores += [ "en_US" ] |
| 90 } | 90 } |
| 91 | 91 |
| 92 group("resources") { | 92 group("resources") { |
| 93 deps = [ | 93 deps = [ |
| 94 ":copy_locales", | 94 ":copy_locales", |
| 95 ":strings", | 95 ":strings", |
| 96 |
| 96 #":verify_resources", TODO(GYP) enable this. | 97 #":verify_resources", TODO(GYP) enable this. |
| 97 ] | 98 ] |
| 98 } | 99 } |
| 99 | 100 |
| 100 # TODO(GYP) enable verify_resources. The bots are complaining about | 101 # TODO(GYP) enable verify_resources. The bots are complaining about |
| 101 # gen/main.html not being found but this doesn't seems to reproduce locally. | 102 # gen/main.html not being found but this doesn't seems to reproduce locally. |
| 102 if (false) { | 103 if (false) { |
| 104 action("verify_resources") { |
| 105 script = "//remoting/tools/verify_resources.py" |
| 103 | 106 |
| 104 action("verify_resources") { | 107 sources_to_verify = [ |
| 105 script = "//remoting/tools/verify_resources.py" | 108 "$root_gen_dir/main.html", |
| 109 "../base/resources_unittest.cc", |
| 110 "../host/continue_window_mac.mm", |
| 111 "../host/disconnect_window_mac.mm", |
| 112 "../host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.
jinja2", |
| 113 "../host/mac/me2me_preference_pane-InfoPlist.strings.jinja2", |
| 114 "../host/win/core.rc.jinja2", |
| 115 "../host/win/host_messages.mc.jinja2", |
| 116 "../host/win/version.rc.jinja2", |
| 117 "../resources/play_store_resources.cc", |
| 118 "../webapp/background/background.js", |
| 119 "../webapp/butter_bar.js", |
| 120 "../webapp/client_screen.js", |
| 121 "../webapp/error.js", |
| 122 "../webapp/host_list.js", |
| 123 "../webapp/host_setup_dialog.js", |
| 124 "../webapp/host_table_entry.js", |
| 125 "../webapp/manifest.json.jinja2", |
| 126 "../webapp/paired_client_manager.js", |
| 127 "../webapp/remoting.js", |
| 128 "../webapp/window_frame.js", |
| 129 ] |
| 106 | 130 |
| 107 sources_to_verify = [ | 131 inputs = [ "remoting_strings.grd" ] + sources_to_verify |
| 108 "$root_gen_dir/main.html", | |
| 109 "../base/resources_unittest.cc", | |
| 110 "../host/continue_window_mac.mm", | |
| 111 "../host/disconnect_window_mac.mm", | |
| 112 "../host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.ji
nja2", | |
| 113 "../host/mac/me2me_preference_pane-InfoPlist.strings.jinja2", | |
| 114 "../host/win/core.rc.jinja2", | |
| 115 "../host/win/host_messages.mc.jinja2", | |
| 116 "../host/win/version.rc.jinja2", | |
| 117 "../resources/play_store_resources.cc", | |
| 118 "../webapp/background/background.js", | |
| 119 "../webapp/butter_bar.js", | |
| 120 "../webapp/client_screen.js", | |
| 121 "../webapp/error.js", | |
| 122 "../webapp/host_list.js", | |
| 123 "../webapp/host_setup_dialog.js", | |
| 124 "../webapp/host_table_entry.js", | |
| 125 "../webapp/manifest.json.jinja2", | |
| 126 "../webapp/paired_client_manager.js", | |
| 127 "../webapp/remoting.js", | |
| 128 "../webapp/window_frame.js", | |
| 129 ] | |
| 130 | 132 |
| 131 inputs = [ | 133 stampfile = "$root_build_dir/remoting_resources_verified_stamp" |
| 132 "remoting_strings.grd", | 134 outputs = [ |
| 133 ] + sources_to_verify | 135 stampfile, |
| 136 ] |
| 134 | 137 |
| 135 stampfile = "$root_build_dir/remoting_resources_verified_stamp" | 138 args = [ |
| 136 outputs = [ stampfile ] | 139 "-t", |
| 140 rebase_path(stampfile, root_build_dir), |
| 141 "-r", |
| 142 rebase_path("remoting_strings.grd", root_build_dir), |
| 143 ] + rebase_path(sources_to_verify, root_build_dir) |
| 137 | 144 |
| 138 args = [ | 145 deps = [ |
| 139 "-t", rebase_path(stampfile, root_build_dir), | 146 "//remoting/webapp:html", |
| 140 "-r", rebase_path("remoting_strings.grd", root_build_dir), | 147 ] # Generates main.html. |
| 141 ] + rebase_path(sources_to_verify, root_build_dir) | 148 } |
| 142 | |
| 143 deps = [ "//remoting/webapp:html" ] # Generates main.html. | |
| 144 } | |
| 145 | |
| 146 } # if false | 149 } # if false |
| 147 | 150 |
| 148 grit("strings") { | 151 grit("strings") { |
| 149 source = "remoting_strings.grd" | 152 source = "remoting_strings.grd" |
| 150 output_name = "remoting_strings" | 153 output_name = "remoting_strings" |
| 151 | 154 |
| 152 # The grd file encodes "remoting/..." in the name, so root everything in the | 155 # The grd file encodes "remoting/..." in the name, so root everything in the |
| 153 # generated file root. | 156 # generated file root. |
| 154 output_dir = root_gen_dir | 157 output_dir = root_gen_dir |
| 155 | 158 |
| 156 outputs = [ | 159 outputs = [ |
| 157 "remoting/base/string_resources.h", | 160 "remoting/base/string_resources.h", |
| 158 ] | 161 ] |
| 159 | 162 |
| 160 # The grd produces a *.pak file and a messages.json file (this one uses | 163 # The grd produces a *.pak file and a messages.json file (this one uses |
| 161 # underscores instead of hyphens) for each locale. | 164 # underscores instead of hyphens) for each locale. |
| 162 outputs += process_file_template( | 165 outputs += |
| 163 remoting_locales, | 166 process_file_template(remoting_locales, |
| 164 [ "remoting/resources/{{source_name_part}}.pak" ]) | 167 [ "remoting/resources/{{source_name_part}}.pak" ]) |
| 165 | 168 |
| 166 messages_locales = remoting_locales_with_underscores | 169 messages_locales = remoting_locales_with_underscores |
| 167 if (!is_chromeos) { | 170 if (!is_chromeos) { |
| 168 # The messages output includes a separate one for en-US that the pak ones | 171 # The messages output includes a separate one for en-US that the pak ones |
| 169 # don't have. We don't need to do this on ChromeOS since en_US is in the | 172 # don't have. We don't need to do this on ChromeOS since en_US is in the |
| 170 # locales list be default there. | 173 # locales list be default there. |
| 171 messages_locales += [ "en_US" ] | 174 messages_locales += [ "en_US" ] |
| 172 } | 175 } |
| 173 outputs += process_file_template( | 176 outputs += process_file_template( |
| 174 messages_locales, | 177 messages_locales, |
| 175 [ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ]) | 178 [ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ]) |
| 176 } | 179 } |
| 177 | 180 |
| 178 action("copy_locales") { | 181 action("copy_locales") { |
| 179 script = "../tools/build/remoting_copy_locales.py" | 182 script = "../tools/build/remoting_copy_locales.py" |
| 180 | 183 |
| 181 # The gyp build calls out to Python, but the Python just computes a simple | 184 # The gyp build calls out to Python, but the Python just computes a simple |
| 182 # replacement over the locales. Here, we can do this in GN script by | 185 # replacement over the locales. Here, we can do this in GN script by |
| 183 # pretending the locale list is a list of files. The {{source_name_part}} | 186 # pretending the locale list is a list of files. The {{source_name_part}} |
| 184 # will just expand to the locale name. | 187 # will just expand to the locale name. |
| 185 inputs = process_file_template( | 188 inputs = process_file_template(remoting_locales, |
| 186 remoting_locales, | 189 [ "$target_gen_dir/{{source_name_part}}.pak" ]) |
| 187 [ "$target_gen_dir/{{source_name_part}}.pak" ]) | |
| 188 | 190 |
| 189 # Likewise, process the outputs in the same way as the inputs. | 191 # Likewise, process the outputs in the same way as the inputs. |
| 190 if (is_mac || is_ios) { | 192 if (is_mac || is_ios) { |
| 191 # On mac, use underscores instead of hyphens and put the files in a | 193 # On mac, use underscores instead of hyphens and put the files in a |
| 192 # different place. | 194 # different place. |
| 193 outputs = process_file_template( | 195 outputs = process_file_template( |
| 194 remoting_locales_with_underscores, | 196 remoting_locales_with_underscores, |
| 195 [ "$root_build_dir/remoting/resources/{{source_name_part}}.lproj/locale.
pak" ]) | 197 [ "$root_build_dir/remoting/resources/{{source_name_part}}.lproj/loc
ale.pak" ]) |
| 196 } else { | 198 } else { |
| 197 outputs = process_file_template( | 199 outputs = process_file_template( |
| 198 remoting_locales, | 200 remoting_locales, |
| 199 [ "$root_build_dir/remoting_locales/{{source_name_part}}.pak" ]) | 201 [ "$root_build_dir/remoting_locales/{{source_name_part}}.pak" ]) |
| 200 } | 202 } |
| 201 | 203 |
| 202 args = [ | 204 args = [ |
| 203 "-p", os, | 205 "-p", |
| 204 "-g", rebase_path(root_gen_dir, root_build_dir), | 206 os, |
| 205 "-x", rebase_path(root_out_dir, root_build_dir), | 207 "-g", |
| 206 ] + remoting_locales | 208 rebase_path(root_gen_dir, root_build_dir), |
| 209 "-x", |
| 210 rebase_path(root_out_dir, root_build_dir), |
| 211 ] + remoting_locales |
| 207 | 212 |
| 208 deps = [ ":strings" ] | 213 deps = [ |
| 214 ":strings", |
| 215 ] |
| 209 } | 216 } |
| OLD | NEW |