Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Side by Side Diff: ios/chrome/extension_repack.gni

Issue 2320883006: 🍵 Refactor the various locale_paks() templates to be more shared (Closed)
Patch Set: another search&replace bug Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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/repack.gni") 5 import("//tools/grit/repack.gni")
6 6
7 # Pack all resources for an application extension for a given locale. 7 # Pack all resources for an application extension for a given locale.
8 # 8 #
9 # Arguments: 9 # Arguments:
10 # 10 #
(...skipping 13 matching lines...) Expand all
24 # data into the final bundle. 24 # data into the final bundle.
25 # 25 #
26 # visibility [optional] 26 # visibility [optional]
27 # usual meaning. 27 # usual meaning.
28 # 28 #
29 template("_extension_repack_one_locale") { 29 template("_extension_repack_one_locale") {
30 assert(defined(invoker.extension), "Need extension for $target_name") 30 assert(defined(invoker.extension), "Need extension for $target_name")
31 assert(defined(invoker.input_locale), "Need input_locale for $target_name") 31 assert(defined(invoker.input_locale), "Need input_locale for $target_name")
32 assert(defined(invoker.output_locale), "Need output_locale for $target_name") 32 assert(defined(invoker.output_locale), "Need output_locale for $target_name")
33 33
34 if (invoker.copy_data_to_bundle) { 34 repack(target_name) {
35 _target_type = "repack_and_bundle"
36 } else {
37 _target_type = "repack"
38 }
39
40 target(_target_type, target_name) {
41 forward_variables_from(invoker, [ "visibility" ]) 35 forward_variables_from(invoker, [ "visibility" ])
42 36
43 deps = [ 37 deps = [
44 "//ios/chrome/${invoker.extension}/strings", 38 "//ios/chrome/${invoker.extension}/strings",
45 ] 39 ]
46 40
47 sources = [ 41 sources = [
48 "$root_gen_dir/ios/${invoker.extension}/" + 42 "$root_gen_dir/ios/${invoker.extension}/" +
49 "ios_${invoker.extension}_strings_${invoker.input_locale}.pak", 43 "ios_${invoker.extension}_strings_${invoker.input_locale}.pak",
50 ] 44 ]
51 45
52 output = "$target_gen_dir/${invoker.output_locale}.lproj/locale.pak" 46 output = "$target_gen_dir/${invoker.output_locale}.lproj/locale.pak"
53 if (invoker.copy_data_to_bundle) { 47 if (invoker.copy_data_to_bundle) {
48 define_bundle_data = true
sdefresne 2016/09/13 07:59:19 Should be: define_bundle_data = invoker.copy_data
agrieve 2016/09/13 14:06:58 Refactored this whole file to use the same locale_
54 bundle_output = "{{bundle_resources_dir}}/" + 49 bundle_output = "{{bundle_resources_dir}}/" +
55 "${invoker.output_locale}.lproj/locale.pak" 50 "${invoker.output_locale}.lproj/locale.pak"
56 } 51 }
57 } 52 }
58 } 53 }
59 54
60 # Pack all resources for an application extension for all locales. 55 # Pack all resources for an application extension for all locales.
61 # 56 #
62 # Arguments: 57 # Arguments:
63 # 58 #
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 111
117 _locale_targets += [ ":$_locale_target" ] 112 _locale_targets += [ ":$_locale_target" ]
118 _current_locale = _current_locale + 1 113 _current_locale = _current_locale + 1
119 } 114 }
120 115
121 group(_target_name) { 116 group(_target_name) {
122 forward_variables_from(invoker, [ "visibility" ]) 117 forward_variables_from(invoker, [ "visibility" ])
123 public_deps = _locale_targets 118 public_deps = _locale_targets
124 } 119 }
125 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698