Home | History | Annotate | Download | only in libaddressinput
      1 # Copyright 2013 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 {
      5   'variables': {
      6     # TODO(rouslan): Use the src/ directory. http://crbug.com/327046
      7     'libaddressinput_dir': 'chromium',
      8   },
      9   'target_defaults': {
     10     'conditions': [
     11       ['OS=="mac" or OS=="ios"', {
     12         'xcode_settings': {
     13           'GCC_WARN_ABOUT_MISSING_NEWLINE': 'NO',
     14         },
     15       }],
     16     ],
     17     'defines': [
     18       'CUSTOM_BASICTYPES="base/basictypes.h"',
     19       'CUSTOM_SCOPED_PTR="base/memory/scoped_ptr.h"',
     20     ],
     21   },
     22   'targets': [
     23     {
     24       'target_name': 'libaddressinput_strings',
     25       'type': 'none',
     26       'variables': {
     27         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libaddressinput/',
     28       },
     29       'actions': [
     30         {
     31           'action_name': 'libaddressinput_strings',
     32           'variables': {
     33             'grit_grd_file': '<(libaddressinput_dir)/cpp/res/libaddressinput_strings.grd',
     34           },
     35           'includes': [
     36             '../../build/grit_action.gypi',
     37           ],
     38         },
     39       ],
     40       'includes': [
     41         '../../build/grit_target.gypi',
     42       ],
     43     },
     44     {
     45       'target_name': 'libaddressinput_updated_strings',
     46       'type': 'none',
     47       'variables': {
     48         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/grit/libaddressinput/',
     49       },
     50       'actions': [
     51         {
     52           'action_name': 'libaddressinput_updated_strings',
     53           'variables': {
     54             'grit_grd_file': '../../chrome/app/address_input_strings.grd',
     55           },
     56           'includes': [
     57             '../../build/grit_action.gypi',
     58           ],
     59         },
     60       ],
     61       'includes': [
     62         '../../build/grit_target.gypi',
     63       ],
     64     },
     65     # This target provides basic functionality which is cooked into the build.
     66     { 'target_name': 'libaddressinput_util',
     67       'type': 'static_library',
     68       'include_dirs': [
     69         '<(libaddressinput_dir)/cpp/include/',
     70         '<(SHARED_INTERMEDIATE_DIR)/libaddressinput/',
     71       ],
     72       'sources': [
     73         'chromium/canonicalize_string.cc',
     74         'chromium/json.cc',
     75         '<(libaddressinput_dir)/cpp/include/libaddressinput/address_data.h',
     76         '<(libaddressinput_dir)/cpp/include/libaddressinput/address_field.h',
     77         '<(libaddressinput_dir)/cpp/include/libaddressinput/util/basictypes.h',
     78         '<(libaddressinput_dir)/cpp/include/libaddressinput/util/internal/basictypes.h',
     79         '<(libaddressinput_dir)/cpp/include/libaddressinput/util/internal/move.h',
     80         '<(libaddressinput_dir)/cpp/include/libaddressinput/util/internal/scoped_ptr.h',
     81         '<(libaddressinput_dir)/cpp/include/libaddressinput/util/internal/template_util.h',
     82         '<(libaddressinput_dir)/cpp/include/libaddressinput/util/scoped_ptr.h',
     83         '<(libaddressinput_dir)/cpp/src/address_data.cc',
     84         '<(libaddressinput_dir)/cpp/src/address_field.cc',
     85         '<(libaddressinput_dir)/cpp/src/region_data_constants.cc',
     86         '<(libaddressinput_dir)/cpp/src/region_data_constants.h',
     87         '<(libaddressinput_dir)/cpp/src/rule.cc',
     88         '<(libaddressinput_dir)/cpp/src/rule.h',
     89         '<(libaddressinput_dir)/cpp/src/util/canonicalize_string.h',
     90         '<(libaddressinput_dir)/cpp/src/util/json.h',
     91         '<(libaddressinput_dir)/cpp/src/util/stl_util.h',
     92         '<(libaddressinput_dir)/cpp/src/util/string_util.cc',
     93         '<(libaddressinput_dir)/cpp/src/util/string_util.h',
     94       ],
     95       'dependencies': [
     96         '<(DEPTH)/base/base.gyp:base',
     97         '<(DEPTH)/base/base.gyp:base_i18n',
     98         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
     99         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
    100         '<(DEPTH)/third_party/re2/re2.gyp:re2',
    101       ],
    102       'direct_dependent_settings': {
    103         'defines': [
    104           'CUSTOM_BASICTYPES="base/basictypes.h"',
    105           'CUSTOM_SCOPED_PTR="base/memory/scoped_ptr.h"',
    106         ],
    107         'include_dirs': [
    108           '<(libaddressinput_dir)/cpp/include/',
    109         ],
    110       },
    111     },
    112     # This target provides more complicated functionality like pinging servers
    113     # for validation rules.
    114     {
    115       'target_name': 'libaddressinput',
    116       'type': 'static_library',
    117       'include_dirs': [
    118         '<(libaddressinput_dir)/cpp/include/',
    119         '<(SHARED_INTERMEDIATE_DIR)/libaddressinput/',
    120       ],
    121       'sources': [
    122         'chromium/chrome_downloader_impl.cc',
    123         'chromium/chrome_downloader_impl.h',
    124         'chromium/chrome_storage_impl.cc',
    125         'chromium/chrome_storage_impl.h',
    126         '<(libaddressinput_dir)/cpp/include/libaddressinput/address_problem.h',
    127         '<(libaddressinput_dir)/cpp/include/libaddressinput/address_ui_component.h',
    128         '<(libaddressinput_dir)/cpp/include/libaddressinput/address_ui.h',
    129         '<(libaddressinput_dir)/cpp/include/libaddressinput/address_validator.h',
    130         '<(libaddressinput_dir)/cpp/include/libaddressinput/load_rules_delegate.h',
    131         '<(libaddressinput_dir)/cpp/src/address_problem.cc',
    132         '<(libaddressinput_dir)/cpp/src/address_ui.cc',
    133         '<(libaddressinput_dir)/cpp/src/address_validator.cc',
    134         '<(libaddressinput_dir)/cpp/src/country_rules_aggregator.cc',
    135         '<(libaddressinput_dir)/cpp/src/country_rules_aggregator.h',
    136         '<(libaddressinput_dir)/cpp/src/fallback_data_store.cc',
    137         '<(libaddressinput_dir)/cpp/src/fallback_data_store.h',
    138         '<(libaddressinput_dir)/cpp/src/grit.h',
    139         '<(libaddressinput_dir)/cpp/src/retriever.cc',
    140         '<(libaddressinput_dir)/cpp/src/retriever.h',
    141         '<(libaddressinput_dir)/cpp/src/ruleset.cc',
    142         '<(libaddressinput_dir)/cpp/src/ruleset.h',
    143         '<(libaddressinput_dir)/cpp/src/util/md5.cc',
    144         '<(libaddressinput_dir)/cpp/src/util/md5.h',
    145         '<(libaddressinput_dir)/cpp/src/util/trie.cc',
    146         '<(libaddressinput_dir)/cpp/src/util/trie.h',
    147       ],
    148       'defines': [
    149         'VALIDATION_DATA_URL="https://i18napis.appspot.com/ssl-aggregate-address/"',
    150       ],
    151       'dependencies': [
    152         'libaddressinput_strings',
    153         'libaddressinput_updated_strings',
    154         'libaddressinput_util',
    155         '<(DEPTH)/base/base.gyp:base',
    156         '<(DEPTH)/base/base.gyp:base_i18n',
    157         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
    158         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
    159         '<(DEPTH)/third_party/re2/re2.gyp:re2',
    160       ],
    161       'direct_dependent_settings': {
    162         'defines': [
    163           'CUSTOM_BASICTYPES="base/basictypes.h"',
    164           'CUSTOM_SCOPED_PTR="base/memory/scoped_ptr.h"',
    165         ],
    166         'include_dirs': [
    167           '<(libaddressinput_dir)/cpp/include/',
    168         ],
    169       },
    170     },
    171     {
    172       'target_name': 'libaddressinput_unittests',
    173       'type': '<(gtest_target_type)',
    174       'include_dirs': [
    175         '<(DEPTH)',
    176         '<(libaddressinput_dir)/cpp/src/',
    177         '<(DEPTH)/testing/gtest/include/',
    178         '<(SHARED_INTERMEDIATE_DIR)/libaddressinput/',
    179       ],
    180       'sources': [
    181         'chromium/chrome_downloader_impl_unittest.cc',
    182         'chromium/chrome_rule_test.cc',
    183         'chromium/chrome_storage_impl_unittest.cc',
    184         '<(libaddressinput_dir)/cpp/test/address_data_test.cc',
    185         '<(libaddressinput_dir)/cpp/test/address_ui_test.cc',
    186         '<(libaddressinput_dir)/cpp/test/address_validator_test.cc',
    187         '<(libaddressinput_dir)/cpp/test/country_rules_aggregator_test.cc',
    188         '<(libaddressinput_dir)/cpp/test/countryinfo_example_addresses_test.cc',
    189         '<(libaddressinput_dir)/cpp/test/fake_downloader.cc',
    190         '<(libaddressinput_dir)/cpp/test/fake_downloader.h',
    191         '<(libaddressinput_dir)/cpp/test/fake_downloader_test.cc',
    192         '<(libaddressinput_dir)/cpp/test/fake_storage.cc',
    193         '<(libaddressinput_dir)/cpp/test/fake_storage.h',
    194         '<(libaddressinput_dir)/cpp/test/fake_storage_test.cc',
    195         '<(libaddressinput_dir)/cpp/test/fallback_data_store_test.cc',
    196         '<(libaddressinput_dir)/cpp/test/region_data_constants_test.cc',
    197         '<(libaddressinput_dir)/cpp/test/retriever_test.cc',
    198         '<(libaddressinput_dir)/cpp/test/rule_test.cc',
    199         '<(libaddressinput_dir)/cpp/test/storage_test_runner.cc',
    200         '<(libaddressinput_dir)/cpp/test/storage_test_runner.h',
    201         '<(libaddressinput_dir)/cpp/test/util/json_test.cc',
    202         '<(libaddressinput_dir)/cpp/test/util/md5_unittest.cc',
    203         '<(libaddressinput_dir)/cpp/test/util/scoped_ptr_unittest.cc',
    204         '<(libaddressinput_dir)/cpp/test/util/stl_util_unittest.cc',
    205         '<(libaddressinput_dir)/cpp/test/util/string_util_test.cc',
    206         '<(libaddressinput_dir)/cpp/test/util/trie_test.cc',
    207       ],
    208       'defines': [
    209         'TEST_DATA_DIR="third_party/libaddressinput/src/testdata"',
    210       ],
    211       'dependencies': [
    212         'libaddressinput',
    213         'libaddressinput_strings',
    214         '<(DEPTH)/base/base.gyp:base_prefs',
    215         '<(DEPTH)/base/base.gyp:run_all_unittests',
    216         '<(DEPTH)/net/net.gyp:net_test_support',
    217         '<(DEPTH)/testing/gtest.gyp:gtest',
    218       ],
    219     },
    220   ],
    221 }
    222