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

Unified Diff: third_party/libaddressinput/BUILD.gn

Issue 389733002: Reland "Use upstream libaddressinput in Chrome." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GN build. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/libaddressinput/BUILD.gn
diff --git a/third_party/libaddressinput/BUILD.gn b/third_party/libaddressinput/BUILD.gn
index 291e54917d0defef597ea379d42dd4ce9d0c3293..8953700aabeb738fd9c9173737272df151aafd6c 100644
--- a/third_party/libaddressinput/BUILD.gn
+++ b/third_party/libaddressinput/BUILD.gn
@@ -4,70 +4,69 @@
import("//tools/grit/grit_rule.gni")
-# TODO(rouslan): Use the src/ directory. http://crbug.com/327046
-libaddressinput_dir = "chromium"
+# The list of files in libaddressinput.gypi.
+gypi_values = exec_script(
+ "//build/gypi_to_gn.py",
+ [ rebase_path("src/cpp/libaddressinput.gypi") ],
+ "scope",
+ [ "src/cpp/libaddressinput.gypi" ])
+
+libaddressinput_util_files = [
+ "src/cpp/src/address_data.cc",
+ "src/cpp/src/address_field.cc",
+ "src/cpp/src/address_field_util.cc",
+ "src/cpp/src/address_formatter.cc",
+ "src/cpp/src/address_metadata.cc",
+ "src/cpp/src/address_ui.cc",
+ "src/cpp/src/format_element.cc",
+ "src/cpp/src/language.cc",
+ "src/cpp/src/localization.cc",
+ "src/cpp/src/lookup_key.cc",
+ "src/cpp/src/region_data_constants.cc",
+ "src/cpp/src/rule.cc",
+ "src/cpp/src/util/cctype_tolower_equal.cc",
+ "src/cpp/src/util/json.cc",
+ "src/cpp/src/util/string_split.cc",
+ "src/cpp/src/util/string_util.cc",
+]
# GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_strings
grit("strings") {
- source = "$libaddressinput_dir/cpp/res/libaddressinput_strings.grd"
-}
-
-# GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_updated_strings
-grit("updated_strings") {
source = "//chrome/app/address_input_strings.grd"
}
config("libaddressinput_config") {
defines = [
- "CUSTOM_BASICTYPES=\"base/basictypes.h\"",
- "CUSTOM_SCOPED_PTR=\"base/memory/scoped_ptr.h\"",
+ "I18N_ADDRESSINPUT_USE_BASICTYPES_OVERRIDE=1",
+ "I18N_ADDRESS_VALIDATION_DATA_URL=\"https://i18napis.appspot.com/ssl-aggregate-address/\"",
+ ]
+ include_dirs = [
+ "src/cpp/include",
+ "chromium/override",
]
- include_dirs = [ "$libaddressinput_dir/cpp/include" ]
}
# This target provides basic functionality which is cooked into the build.
# GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput_util
static_library("util") {
- sources = [
+ sources = libaddressinput_util_files
+ sources += [
"chromium/addressinput_util.cc",
- "chromium/addressinput_util.h",
- "chromium/canonicalize_string.cc",
"chromium/json.cc",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_data.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_field.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_formatter.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_metadata.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_problem.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/util/basictypes.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/basictypes.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/move.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/scoped_ptr.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/util/internal/template_util.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/util/scoped_ptr.h",
- "$libaddressinput_dir/cpp/src/address_data.cc",
- "$libaddressinput_dir/cpp/src/address_field.cc",
- "$libaddressinput_dir/cpp/src/address_formatter.cc",
- "$libaddressinput_dir/cpp/src/address_metadata.cc",
- "$libaddressinput_dir/cpp/src/address_problem.cc",
- "$libaddressinput_dir/cpp/src/language.cc",
- "$libaddressinput_dir/cpp/src/language.h",
- "$libaddressinput_dir/cpp/src/region_data_constants.cc",
- "$libaddressinput_dir/cpp/src/region_data_constants.h",
- "$libaddressinput_dir/cpp/src/rule.cc",
- "$libaddressinput_dir/cpp/src/rule.h",
- "$libaddressinput_dir/cpp/src/util/canonicalize_string.h",
- "$libaddressinput_dir/cpp/src/util/cctype_tolower_equal.cc",
- "$libaddressinput_dir/cpp/src/util/cctype_tolower_equal.h",
- "$libaddressinput_dir/cpp/src/util/json.h",
- "$libaddressinput_dir/cpp/src/util/stl_util.h",
- "$libaddressinput_dir/cpp/src/util/string_util.cc",
- "$libaddressinput_dir/cpp/src/util/string_util.h",
]
+ sources -= [
+ "src/cpp/src/util/json.cc",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
direct_dependent_configs = [ ":libaddressinput_config" ]
- include_dirs = [ "$root_gen_dir/libaddressinput" ]
+
+ include_dirs = [ "$root_gen_dir/third_party/libaddressinput" ]
deps = [
+ ":strings",
"//base",
"//base:i18n",
"//third_party/icu",
@@ -79,41 +78,28 @@ static_library("util") {
# for validation rules.
# GYP version: third_party/libaddressinput/libaddressinput.gyp:libaddressinput
static_library("libaddressinput") {
- sources = [
+ sources = rebase_path(gypi_values.libaddressinput_files, ".", "src/cpp")
+ sources += [
+ "chromium/chrome_address_validator.cc",
"chromium/chrome_downloader_impl.cc",
- "chromium/chrome_downloader_impl.h",
"chromium/chrome_storage_impl.cc",
- "chromium/chrome_storage_impl.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_ui_component.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_ui.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/address_validator.h",
- "$libaddressinput_dir/cpp/include/libaddressinput/load_rules_delegate.h",
- "$libaddressinput_dir/cpp/src/address_ui.cc",
- "$libaddressinput_dir/cpp/src/address_validator.cc",
- "$libaddressinput_dir/cpp/src/country_rules_aggregator.cc",
- "$libaddressinput_dir/cpp/src/country_rules_aggregator.h",
- "$libaddressinput_dir/cpp/src/fallback_data_store.cc",
- "$libaddressinput_dir/cpp/src/fallback_data_store.h",
- "$libaddressinput_dir/cpp/src/grit.h",
- "$libaddressinput_dir/cpp/src/retriever.cc",
- "$libaddressinput_dir/cpp/src/retriever.h",
- "$libaddressinput_dir/cpp/src/ruleset.cc",
- "$libaddressinput_dir/cpp/src/ruleset.h",
- "$libaddressinput_dir/cpp/src/util/md5.cc",
- "$libaddressinput_dir/cpp/src/util/md5.h",
- "$libaddressinput_dir/cpp/src/util/trie.cc",
- "$libaddressinput_dir/cpp/src/util/trie.h",
+ "chromium/fallback_data_store.cc",
+ "chromium/input_suggester.cc",
+ "chromium/string_compare.cc",
+ "chromium/trie.cc",
+ ]
+ sources -= libaddressinput_util_files
+ sources -= [
+ "src/cpp/src/util/string_compare.cc",
]
- direct_dependent_configs = [ ":libaddressinput_config" ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
- defines = [
- "VALIDATION_DATA_URL=\"https://i18napis.appspot.com/ssl-aggregate-address/\"",
- ]
+ direct_dependent_configs = [ ":libaddressinput_config" ]
deps = [
":strings",
- ":updated_strings",
":util",
"//base",
"//base:i18n",
@@ -123,42 +109,27 @@ static_library("libaddressinput") {
}
test("libaddressinput_unittests") {
- sources = [
+ sources = rebase_path(gypi_values.libaddressinput_test_files, ".", "src/cpp")
+ sources += [
"chromium/addressinput_util_unittest.cc",
+ "chromium/chrome_address_validator_unittest.cc",
"chromium/chrome_downloader_impl_unittest.cc",
- "chromium/chrome_rule_test.cc",
"chromium/chrome_storage_impl_unittest.cc",
- "$libaddressinput_dir/cpp/test/address_data_test.cc",
- "$libaddressinput_dir/cpp/test/address_ui_test.cc",
- "$libaddressinput_dir/cpp/test/address_validator_test.cc",
- "$libaddressinput_dir/cpp/test/country_rules_aggregator_test.cc",
- "$libaddressinput_dir/cpp/test/countryinfo_example_addresses_test.cc",
- "$libaddressinput_dir/cpp/test/fake_downloader.cc",
- "$libaddressinput_dir/cpp/test/fake_downloader.h",
- "$libaddressinput_dir/cpp/test/fake_downloader_test.cc",
- "$libaddressinput_dir/cpp/test/fake_storage.cc",
- "$libaddressinput_dir/cpp/test/fake_storage.h",
- "$libaddressinput_dir/cpp/test/fake_storage_test.cc",
- "$libaddressinput_dir/cpp/test/fallback_data_store_test.cc",
- "$libaddressinput_dir/cpp/test/region_data_constants_test.cc",
- "$libaddressinput_dir/cpp/test/retriever_test.cc",
- "$libaddressinput_dir/cpp/test/rule_test.cc",
- "$libaddressinput_dir/cpp/test/storage_test_runner.cc",
- "$libaddressinput_dir/cpp/test/storage_test_runner.h",
- "$libaddressinput_dir/cpp/test/util/json_test.cc",
- "$libaddressinput_dir/cpp/test/util/md5_unittest.cc",
- "$libaddressinput_dir/cpp/test/util/scoped_ptr_unittest.cc",
- "$libaddressinput_dir/cpp/test/util/stl_util_unittest.cc",
- "$libaddressinput_dir/cpp/test/util/string_util_test.cc",
- "$libaddressinput_dir/cpp/test/util/trie_test.cc",
+ "chromium/fallback_data_store_unittest.cc",
+ "chromium/storage_test_runner.cc",
+ "chromium/string_compare_unittest.cc",
+ "chromium/trie_unittest.cc",
]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+
defines = [
"TEST_DATA_DIR=\"third_party/libaddressinput/src/testdata\"",
]
include_dirs = [
- "$libaddressinput_dir/cpp/src",
+ "src/cpp/src",
]
deps = [
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | third_party/libaddressinput/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698