Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / google_apis / google_apis.gyp
blob096965175f16d2605cecfdb6b48a2659515649ec
1 # Copyright (c) 2012 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.
6   'variables': {
7     'chromium_code': 1,  # Use higher warning level.
8   },
9   'includes': [
10     '../build/win_precompile.gypi',
11   ],
12   'targets': [
13     {
14       # GN version: //google_apis
15       'target_name': 'google_apis',
16       'type': 'static_library',
17       'includes': [
18         'determine_use_official_keys.gypi',
19       ],
20       'dependencies': [
21         '../base/base.gyp:base',
22         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
23         '../crypto/crypto.gyp:crypto',
24         '../net/net.gyp:net',
25         '../third_party/libxml/libxml.gyp:libxml',
26         '../url/url.gyp:url_lib',
27       ],
28       'conditions': [
29         ['google_api_key!=""', {
30           'defines': ['GOOGLE_API_KEY="<(google_api_key)"'],
31         }],
32         ['google_default_client_id!=""', {
33           'defines': [
34             'GOOGLE_DEFAULT_CLIENT_ID="<(google_default_client_id)"',
35           ]
36         }],
37         ['google_default_client_secret!=""', {
38           'defines': [
39             'GOOGLE_DEFAULT_CLIENT_SECRET="<(google_default_client_secret)"',
40           ]
41         }],
42         ['enable_extensions==1', {
43           'sources': [
44             # Note: sources list duplicated in GN build.
45             'drive/auth_service.cc',
46             'drive/auth_service.h',
47             'drive/auth_service_interface.h',
48             'drive/auth_service_observer.h',
49             'drive/base_requests.cc',
50             'drive/base_requests.h',
51             'drive/drive_api_error_codes.cc',
52             'drive/drive_api_error_codes.h',
53             'drive/drive_api_parser.cc',
54             'drive/drive_api_parser.h',
55             'drive/drive_api_requests.cc',
56             'drive/drive_api_requests.h',
57             'drive/drive_api_url_generator.cc',
58             'drive/drive_api_url_generator.h',
59             'drive/drive_common_callbacks.h',
60             'drive/request_sender.cc',
61             'drive/request_sender.h',
62             'drive/request_util.cc',
63             'drive/request_util.h',
64             'drive/task_util.cc',
65             'drive/task_util.h',
66             'drive/time_util.cc',
67             'drive/time_util.h',
68           ],
69         }],
70       ],
71       'sources': [
72         # Note: sources list duplicated in GN build.
73         'gaia/account_tracker.cc',
74         'gaia/account_tracker.h',
75         'gaia/gaia_auth_consumer.cc',
76         'gaia/gaia_auth_consumer.h',
77         'gaia/gaia_auth_fetcher.cc',
78         'gaia/gaia_auth_fetcher.h',
79         'gaia/gaia_auth_util.cc',
80         'gaia/gaia_auth_util.h',
81         'gaia/gaia_constants.cc',
82         'gaia/gaia_constants.h',
83         'gaia/gaia_oauth_client.cc',
84         'gaia/gaia_oauth_client.h',
85         'gaia/gaia_switches.cc',
86         'gaia/gaia_switches.h',
87         'gaia/gaia_urls.cc',
88         'gaia/gaia_urls.h',
89         'gaia/google_service_auth_error.cc',
90         'gaia/google_service_auth_error.h',
91         'gaia/identity_provider.cc',
92         'gaia/identity_provider.h',
93         'gaia/oauth2_access_token_consumer.h',
94         'gaia/oauth2_access_token_fetcher.cc',
95         'gaia/oauth2_access_token_fetcher.h',
96         'gaia/oauth2_access_token_fetcher_impl.cc',
97         'gaia/oauth2_access_token_fetcher_impl.h',
98         'gaia/oauth2_access_token_fetcher_permanent_error.cc',
99         'gaia/oauth2_access_token_fetcher_permanent_error.h',
100         'gaia/oauth2_api_call_flow.cc',
101         'gaia/oauth2_api_call_flow.h',
102         'gaia/oauth2_mint_token_flow.cc',
103         'gaia/oauth2_mint_token_flow.h',
104         'gaia/oauth2_token_service.cc',
105         'gaia/oauth2_token_service.h',
106         'gaia/oauth2_token_service_request.cc',
107         'gaia/oauth2_token_service_request.h',
108         'gaia/oauth_request_signer.cc',
109         'gaia/oauth_request_signer.h',
110         'gaia/ubertoken_fetcher.cc',
111         'gaia/ubertoken_fetcher.h',
112         'google_api_keys.cc',
113         'google_api_keys.h',
114       ],
115       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
116       'msvs_disabled_warnings': [4267, ],
117     },
118     {
119       'target_name': 'google_apis_unittests',
120       'type': 'executable',
121       'dependencies': [
122         '../base/base.gyp:run_all_unittests',
123         '../testing/gmock.gyp:gmock',
124         '../testing/gtest.gyp:gtest',
125         'google_apis',
126         'google_apis_test_support',
127       ],
128       'includes': [
129         'determine_use_official_keys.gypi',
130       ],
131       'include_dirs': [
132         '..',
133       ],
134       'sources': [
135         'gaia/account_tracker_unittest.cc',
136         'gaia/gaia_auth_fetcher_unittest.cc',
137         'gaia/gaia_auth_util_unittest.cc',
138         'gaia/gaia_oauth_client_unittest.cc',
139         'gaia/google_service_auth_error_unittest.cc',
140         'gaia/oauth2_access_token_fetcher_impl_unittest.cc',
141         'gaia/oauth2_api_call_flow_unittest.cc',
142         'gaia/oauth2_mint_token_flow_unittest.cc',
143         'gaia/oauth2_token_service_request_unittest.cc',
144         'gaia/oauth2_token_service_unittest.cc',
145         'gaia/oauth_request_signer_unittest.cc',
146         'gaia/ubertoken_fetcher_unittest.cc',
147         'google_api_keys_unittest.cc',
148       ],
149       'conditions': [
150         ['enable_extensions==1', {
151           'sources': [
152             'drive/base_requests_server_unittest.cc',
153             'drive/base_requests_unittest.cc',
154             'drive/drive_api_parser_unittest.cc',
155             'drive/drive_api_requests_unittest.cc',
156             'drive/drive_api_url_generator_unittest.cc',
157             'drive/request_sender_unittest.cc',
158             'drive/request_util_unittest.cc',
159             'drive/time_util_unittest.cc',
160           ],
161         }],
162       ],
163     },
164     {
165       # GN version: //google_apis:test_support
166       'target_name': 'google_apis_test_support',
167       'type': 'static_library',
168       'dependencies': [
169         '../base/base.gyp:base',
170         '../base/base.gyp:test_support_base',
171         '../net/net.gyp:net',
172         '../net/net.gyp:net_test_support',
173       ],
174       'export_dependent_settings': [
175         '../base/base.gyp:base',
176         '../base/base.gyp:test_support_base',
177         '../net/net.gyp:net',
178         '../net/net.gyp:net_test_support',
179       ],
180       'sources': [
181         'gaia/fake_gaia.cc',
182         'gaia/fake_gaia.h',
183         'gaia/fake_identity_provider.cc',
184         'gaia/fake_identity_provider.h',
185         'gaia/fake_oauth2_token_service.cc',
186         'gaia/fake_oauth2_token_service.h',
187         'gaia/mock_url_fetcher_factory.h',
188         'gaia/oauth2_token_service_test_util.cc',
189         'gaia/oauth2_token_service_test_util.h',
190       ],
191       'conditions': [
192         ['enable_extensions==1', {
193           'sources': [
194             'drive/dummy_auth_service.cc',
195             'drive/dummy_auth_service.h',
196             'drive/test_util.cc',
197             'drive/test_util.h',
198           ],
199         }],
200       ],
201     },
202   ],