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 # The list of files in libaddressinput.gypi. | 7 # TODO(rouslan): Use the src/ directory. http://crbug.com/327046 |
8 gypi_values = exec_script( | 8 libaddressinput_dir = "chromium" |
9 "//build/gypi_to_gn.py", | |
10 [ rebase_path("src/cpp/libaddressinput.gypi") ], | |
11 "scope", | |
12 [ "src/cpp/libaddressinput.gypi" ]) | |
13 | |
14 libaddressinput_util_files = [ | |
15 "src/cpp/src/address_data.cc", | |
16 "src/cpp/src/address_field.cc", | |
17 "src/cpp/src/address_field_util.cc", | |
18 "src/cpp/src/address_formatter.cc", | |
19 "src/cpp/src/address_metadata.cc", | |
20 "src/cpp/src/address_ui.cc", | |
21 "src/cpp/src/format_element.cc", | |
22 "src/cpp/src/language.cc", | |
23 "src/cpp/src/localization.cc", | |
24 "src/cpp/src/lookup_key.cc", | |
25 "src/cpp/src/region_data_constants.cc", | |
26 "src/cpp/src/rule.cc", | |
27 "src/cpp/src/util/cctype_tolower_equal.cc", | |
28 "src/cpp/src/util/json.cc", | |
29 "src/cpp/src/util/string_split.cc", | |
30 "src/cpp/src/util/string_util.cc", | |
31 ] | |
32 | 9 |
33 # GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_s
trings | 10 # GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_s
trings |
34 grit("strings") { | 11 grit("strings") { |
| 12 source = "$libaddressinput_dir/cpp/res/libaddressinput_strings.grd" |
| 13 } |
| 14 |
| 15 # GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_u
pdated_strings |
| 16 grit("updated_strings") { |
35 source = "//chrome/app/address_input_strings.grd" | 17 source = "//chrome/app/address_input_strings.grd" |
36 } | 18 } |
37 | 19 |
38 config("libaddressinput_config") { | 20 config("libaddressinput_config") { |
39 defines = [ | 21 defines = [ |
40 "I18N_ADDRESSINPUT_USE_BASICTYPES_OVERRIDE=1", | 22 "CUSTOM_BASICTYPES=\"base/basictypes.h\"", |
41 "VALIDATION_DATA_URL=\"https://i18napis.appspot.com/ssl-aggregate-address/\"
", | 23 "CUSTOM_SCOPED_PTR=\"base/memory/scoped_ptr.h\"", |
42 ] | 24 ] |
43 include_dirs = [ | 25 include_dirs = [ "$libaddressinput_dir/cpp/include" ] |
44 "src/cpp/include", | |
45 "chromium/override", | |
46 ] | |
47 } | 26 } |
48 | 27 |
49 # This target provides basic functionality which is cooked into the build. | 28 # This target provides basic functionality which is cooked into the build. |
50 # GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_u
til | 29 # GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_u
til |
51 static_library("util") { | 30 static_library("util") { |
52 sources = libaddressinput_util_files | 31 sources = [ |
53 sources += [ | |
54 "chromium/addressinput_util.cc", | 32 "chromium/addressinput_util.cc", |
| 33 "chromium/addressinput_util.h", |
| 34 "chromium/canonicalize_string.cc", |
55 "chromium/json.cc", | 35 "chromium/json.cc", |
56 ] | 36 "$libaddressinput_dir/cpp/include/libaddressinput/address_data.h", |
57 sources -= [ | 37 "$libaddressinput_dir/cpp/include/libaddressinput/address_field.h", |
58 "src/cpp/src/util/json.cc", | 38 "$libaddressinput_dir/cpp/include/libaddressinput/address_formatter.h", |
| 39 "$libaddressinput_dir/cpp/include/libaddressinput/address_metadata.h", |
| 40 "$libaddressinput_dir/cpp/include/libaddressinput/address_problem.h", |
| 41 "$libaddressinput_dir/cpp/include/libaddressinput/util/basictypes.h", |
| 42 "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/basictypes.h
", |
| 43 "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/move.h", |
| 44 "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/scoped_ptr.h
", |
| 45 "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/template_uti
l.h", |
| 46 "$libaddressinput_dir/cpp/include/libaddressinput/util/scoped_ptr.h", |
| 47 "$libaddressinput_dir/cpp/src/address_data.cc", |
| 48 "$libaddressinput_dir/cpp/src/address_field.cc", |
| 49 "$libaddressinput_dir/cpp/src/address_formatter.cc", |
| 50 "$libaddressinput_dir/cpp/src/address_metadata.cc", |
| 51 "$libaddressinput_dir/cpp/src/address_problem.cc", |
| 52 "$libaddressinput_dir/cpp/src/language.cc", |
| 53 "$libaddressinput_dir/cpp/src/language.h", |
| 54 "$libaddressinput_dir/cpp/src/region_data_constants.cc", |
| 55 "$libaddressinput_dir/cpp/src/region_data_constants.h", |
| 56 "$libaddressinput_dir/cpp/src/rule.cc", |
| 57 "$libaddressinput_dir/cpp/src/rule.h", |
| 58 "$libaddressinput_dir/cpp/src/util/canonicalize_string.h", |
| 59 "$libaddressinput_dir/cpp/src/util/cctype_tolower_equal.cc", |
| 60 "$libaddressinput_dir/cpp/src/util/cctype_tolower_equal.h", |
| 61 "$libaddressinput_dir/cpp/src/util/json.h", |
| 62 "$libaddressinput_dir/cpp/src/util/stl_util.h", |
| 63 "$libaddressinput_dir/cpp/src/util/string_util.cc", |
| 64 "$libaddressinput_dir/cpp/src/util/string_util.h", |
59 ] | 65 ] |
60 | 66 |
61 configs -= [ "//build/config/compiler:chromium_code" ] | |
62 configs += [ "//build/config/compiler:no_chromium_code" ] | |
63 | |
64 direct_dependent_configs = [ ":libaddressinput_config" ] | 67 direct_dependent_configs = [ ":libaddressinput_config" ] |
65 | 68 include_dirs = [ "$root_gen_dir/libaddressinput" ] |
66 include_dirs = [ "$root_gen_dir/third_party/libaddressinput" ] | |
67 | 69 |
68 deps = [ | 70 deps = [ |
69 ":strings", | |
70 "//base", | 71 "//base", |
71 "//base:i18n", | 72 "//base:i18n", |
72 "//third_party/icu", | 73 "//third_party/icu", |
73 "//third_party/re2", | 74 "//third_party/re2", |
74 ] | 75 ] |
75 } | 76 } |
76 | 77 |
77 # This target provides more complicated functionality like pinging servers | 78 # This target provides more complicated functionality like pinging servers |
78 # for validation rules. | 79 # for validation rules. |
79 # GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput | 80 # GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput |
80 static_library("libaddressinput") { | 81 static_library("libaddressinput") { |
81 sources = rebase_path(gypi_values.libaddressinput_files, ".", "src/cpp") | 82 sources = [ |
82 sources += [ | |
83 "chromium/chrome_address_validator.cc", | |
84 "chromium/chrome_downloader_impl.cc", | 83 "chromium/chrome_downloader_impl.cc", |
| 84 "chromium/chrome_downloader_impl.h", |
85 "chromium/chrome_storage_impl.cc", | 85 "chromium/chrome_storage_impl.cc", |
86 "chromium/fallback_data_store.cc", | 86 "chromium/chrome_storage_impl.h", |
87 "chromium/input_suggester.cc", | 87 "$libaddressinput_dir/cpp/include/libaddressinput/address_ui_component.h", |
88 "chromium/string_compare.cc", | 88 "$libaddressinput_dir/cpp/include/libaddressinput/address_ui.h", |
89 "chromium/trie.cc", | 89 "$libaddressinput_dir/cpp/include/libaddressinput/address_validator.h", |
| 90 "$libaddressinput_dir/cpp/include/libaddressinput/load_rules_delegate.h", |
| 91 "$libaddressinput_dir/cpp/src/address_ui.cc", |
| 92 "$libaddressinput_dir/cpp/src/address_validator.cc", |
| 93 "$libaddressinput_dir/cpp/src/country_rules_aggregator.cc", |
| 94 "$libaddressinput_dir/cpp/src/country_rules_aggregator.h", |
| 95 "$libaddressinput_dir/cpp/src/fallback_data_store.cc", |
| 96 "$libaddressinput_dir/cpp/src/fallback_data_store.h", |
| 97 "$libaddressinput_dir/cpp/src/grit.h", |
| 98 "$libaddressinput_dir/cpp/src/retriever.cc", |
| 99 "$libaddressinput_dir/cpp/src/retriever.h", |
| 100 "$libaddressinput_dir/cpp/src/ruleset.cc", |
| 101 "$libaddressinput_dir/cpp/src/ruleset.h", |
| 102 "$libaddressinput_dir/cpp/src/util/md5.cc", |
| 103 "$libaddressinput_dir/cpp/src/util/md5.h", |
| 104 "$libaddressinput_dir/cpp/src/util/trie.cc", |
| 105 "$libaddressinput_dir/cpp/src/util/trie.h", |
90 ] | 106 ] |
91 sources -= libaddressinput_util_files | |
92 sources -= [ | |
93 "src/cpp/src/util/string_compare.cc", | |
94 ] | |
95 | |
96 configs -= [ "//build/config/compiler:chromium_code" ] | |
97 configs += [ "//build/config/compiler:no_chromium_code" ] | |
98 | 107 |
99 direct_dependent_configs = [ ":libaddressinput_config" ] | 108 direct_dependent_configs = [ ":libaddressinput_config" ] |
100 | 109 |
| 110 defines = [ |
| 111 "VALIDATION_DATA_URL=\"https://i18napis.appspot.com/ssl-aggregate-address/\"
", |
| 112 ] |
| 113 |
101 deps = [ | 114 deps = [ |
102 ":strings", | 115 ":strings", |
| 116 ":updated_strings", |
103 ":util", | 117 ":util", |
104 "//base", | 118 "//base", |
105 "//base:i18n", | 119 "//base:i18n", |
106 "//third_party/icu", | 120 "//third_party/icu", |
107 "//third_party/re2", | 121 "//third_party/re2", |
108 ] | 122 ] |
109 } | 123 } |
110 | 124 |
111 test("libaddressinput_unittests") { | 125 test("libaddressinput_unittests") { |
112 sources = rebase_path(gypi_values.libaddressinput_test_files, ".", "src/cpp") | 126 sources = [ |
113 sources += [ | |
114 "chromium/addressinput_util_unittest.cc", | 127 "chromium/addressinput_util_unittest.cc", |
115 "chromium/chrome_address_validator_unittest.cc", | |
116 "chromium/chrome_downloader_impl_unittest.cc", | 128 "chromium/chrome_downloader_impl_unittest.cc", |
| 129 "chromium/chrome_rule_test.cc", |
117 "chromium/chrome_storage_impl_unittest.cc", | 130 "chromium/chrome_storage_impl_unittest.cc", |
118 "chromium/fallback_data_store_unittest.cc", | 131 "$libaddressinput_dir/cpp/test/address_data_test.cc", |
119 "chromium/storage_test_runner.cc", | 132 "$libaddressinput_dir/cpp/test/address_ui_test.cc", |
120 "chromium/string_compare_unittest.cc", | 133 "$libaddressinput_dir/cpp/test/address_validator_test.cc", |
121 "chromium/trie_unittest.cc", | 134 "$libaddressinput_dir/cpp/test/country_rules_aggregator_test.cc", |
| 135 "$libaddressinput_dir/cpp/test/countryinfo_example_addresses_test.cc", |
| 136 "$libaddressinput_dir/cpp/test/fake_downloader.cc", |
| 137 "$libaddressinput_dir/cpp/test/fake_downloader.h", |
| 138 "$libaddressinput_dir/cpp/test/fake_downloader_test.cc", |
| 139 "$libaddressinput_dir/cpp/test/fake_storage.cc", |
| 140 "$libaddressinput_dir/cpp/test/fake_storage.h", |
| 141 "$libaddressinput_dir/cpp/test/fake_storage_test.cc", |
| 142 "$libaddressinput_dir/cpp/test/fallback_data_store_test.cc", |
| 143 "$libaddressinput_dir/cpp/test/region_data_constants_test.cc", |
| 144 "$libaddressinput_dir/cpp/test/retriever_test.cc", |
| 145 "$libaddressinput_dir/cpp/test/rule_test.cc", |
| 146 "$libaddressinput_dir/cpp/test/storage_test_runner.cc", |
| 147 "$libaddressinput_dir/cpp/test/storage_test_runner.h", |
| 148 "$libaddressinput_dir/cpp/test/util/json_test.cc", |
| 149 "$libaddressinput_dir/cpp/test/util/md5_unittest.cc", |
| 150 "$libaddressinput_dir/cpp/test/util/scoped_ptr_unittest.cc", |
| 151 "$libaddressinput_dir/cpp/test/util/stl_util_unittest.cc", |
| 152 "$libaddressinput_dir/cpp/test/util/string_util_test.cc", |
| 153 "$libaddressinput_dir/cpp/test/util/trie_test.cc", |
122 ] | 154 ] |
123 | 155 |
124 configs -= [ "//build/config/compiler:chromium_code" ] | |
125 configs += [ "//build/config/compiler:no_chromium_code" ] | |
126 | |
127 defines = [ | 156 defines = [ |
128 "TEST_DATA_DIR=\"third_party/libaddressinput/src/testdata\"", | 157 "TEST_DATA_DIR=\"third_party/libaddressinput/src/testdata\"", |
129 ] | 158 ] |
130 | 159 |
131 include_dirs = [ | 160 include_dirs = [ |
132 "src/cpp/src", | 161 "$libaddressinput_dir/cpp/src", |
133 ] | 162 ] |
134 | 163 |
135 deps = [ | 164 deps = [ |
136 ":libaddressinput", | 165 ":libaddressinput", |
137 ":strings", | 166 ":strings", |
138 "//base:prefs", | 167 "//base:prefs", |
139 "//base/test:run_all_unittests", | 168 "//base/test:run_all_unittests", |
140 "//net:test_support", | 169 "//net:test_support", |
141 "//testing/gtest", | 170 "//testing/gtest", |
142 ] | 171 ] |
143 } | 172 } |
OLD | NEW |