| 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 # This is a copy of src/chrome/chrome_repack_locales.gni with the necessary | 5 # This is a copy of src/chrome/chrome_repack_locales.gni with the necessary |
| 6 # modifications to meet WebView's requirement. | 6 # modifications to meet WebView's requirement. |
| 7 | 7 |
| 8 import("//build/config/chrome_build.gni") | 8 import("//build/config/chrome_build.gni") |
| 9 import("//build/config/features.gni") | 9 import("//build/config/features.gni") |
| 10 import("//build/config/ui.gni") | 10 import("//build/config/ui.gni") |
| 11 import("//tools/grit/repack.gni") | 11 import("//tools/grit/repack.gni") |
| 12 import("webview_repack_locales_list.gni") |
| 12 | 13 |
| 13 # Arguments: | 14 # Arguments: |
| 14 # | 15 # |
| 15 # locale | 16 # locale |
| 16 # Internal name of locale. e.g. "pt-BR" | 17 # Internal name of locale. e.g. "pt-BR" |
| 17 # | 18 # |
| 18 # output | 19 # output |
| 19 # Output file name. | 20 # Output file name. |
| 20 # | 21 # |
| 21 # visibility | 22 # visibility |
| 22 # Normal meaning. | 23 # Normal meaning. |
| 23 template("_repack_one_locale") { | 24 template("_repack_one_locale") { |
| 24 locale = invoker.locale | 25 locale = invoker.locale |
| 25 | 26 |
| 26 repack(target_name) { | 27 repack(target_name) { |
| 27 visibility = invoker.visibility | 28 visibility = invoker.visibility |
| 28 | 29 |
| 30 # Adding webview specific pak file? You should add it to |
| 31 # webview_repack_locales_source_patterns, so it is also included in |
| 32 # Monochrome. |
| 33 |
| 29 # Each input pak file should also have a deps line for completeness. | 34 # Each input pak file should also have a deps line for completeness. |
| 30 sources = [ | 35 sources = [ |
| 31 "${root_gen_dir}/android_webview/aw_strings_${locale}.pak", | |
| 32 "${root_gen_dir}/android_webview/components_strings_${locale}.pak", | 36 "${root_gen_dir}/android_webview/components_strings_${locale}.pak", |
| 33 "${root_gen_dir}/content/app/strings/content_strings_${locale}.pak", | 37 "${root_gen_dir}/content/app/strings/content_strings_${locale}.pak", |
| 34 ] | 38 ] |
| 35 deps = [ | 39 deps = [ |
| 36 "//android_webview:generate_aw_strings", | |
| 37 "//android_webview:generate_components_strings", | 40 "//android_webview:generate_components_strings", |
| 38 "//content/app/strings", | 41 "//content/app/strings", |
| 39 ] | 42 ] |
| 43 sources += process_file_template(webview_repack_locales_source_patterns, |
| 44 [ "{{source}}_${locale}.pak" ]) |
| 45 deps += webview_repack_locales_deps |
| 40 output = invoker.output | 46 output = invoker.output |
| 41 } | 47 } |
| 42 } | 48 } |
| 43 | 49 |
| 44 # Creates an action to call the repack_locales script. | 50 # Creates an action to call the repack_locales script. |
| 45 # | 51 # |
| 46 # The GYP version generates the locales in the "gen" directory and then copies | 52 # The GYP version generates the locales in the "gen" directory and then copies |
| 47 # it to the root build directory. This isn't easy to express in a GN copy | 53 # it to the root build directory. This isn't easy to express in a GN copy |
| 48 # rule since the files on Mac have a complex structure. So we generate the | 54 # rule since the files on Mac have a complex structure. So we generate the |
| 49 # files into the final place and skip the "gen" directory. | 55 # files into the final place and skip the "gen" directory. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 99 |
| 94 current_index = current_index + 1 | 100 current_index = current_index + 1 |
| 95 } | 101 } |
| 96 | 102 |
| 97 # The group that external targets depend on which collects all deps. | 103 # The group that external targets depend on which collects all deps. |
| 98 group(group_target_name) { | 104 group(group_target_name) { |
| 99 forward_variables_from(invoker, [ "visibility" ]) | 105 forward_variables_from(invoker, [ "visibility" ]) |
| 100 public_deps = locale_targets | 106 public_deps = locale_targets |
| 101 } | 107 } |
| 102 } | 108 } |
| OLD | NEW |