Roll DEPS for libelf clang compilation fix.
[chromium-blink-merge.git] / third_party / cacheinvalidation / cacheinvalidation.gyp
blob568f40220de31664af7163ef110d278335e155ae
1 # Copyright 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     # This library should build cleanly with the extra warnings turned on
8     # for Chromium.
9     'chromium_code': 1,
10   },
11   'targets': [
12     # The C++ files generated from the cache invalidation protocol buffers.
13     {
14       'target_name': 'cacheinvalidation_proto_cpp',
15       'type': 'static_library',
16       'variables': {
17         # The relative path of the cacheinvalidation proto files from this
18         # gyp-file.
19         # TODO(akalin): Add a RULE_INPUT_DIR predefined variable to gyp so
20         # we don't need this variable.
21         'proto_dir_relpath': 'google/cacheinvalidation',
22         # Where files generated from proto files are put.
23         'proto_in_dir': 'src/<(proto_dir_relpath)',
24         'proto_out_dir': '<(proto_dir_relpath)',
25       },
26       'sources': [
27         '<(proto_in_dir)/android_channel.proto',
28         '<(proto_in_dir)/channel_common.proto',
29         '<(proto_in_dir)/client.proto',
30         '<(proto_in_dir)/client_gateway.proto',
31         '<(proto_in_dir)/client_protocol.proto',
32         '<(proto_in_dir)/client_test_internal.proto',
33         '<(proto_in_dir)/types.proto',
34       ],
35       'includes': [ '../../build/protoc.gypi' ],
36       'direct_dependent_settings': {
37         'include_dirs': [
38           '<(proto_out_dir)',
39         ],
40       },
41       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
42       'msvs_disabled_warnings': [4267, ],
43       # channel_common.proto contains definition of ANDROID constant which on 
44       # android build conflicts with compiler option -DANDROID. Remove protos
45       # from android build.
46       'conditions': [
47         ['OS=="android"', {
48           'sources!': [
49             '<(proto_in_dir)/android_channel.proto',
50             '<(proto_in_dir)/channel_common.proto',
51           ],
52         }],
53       ],
54     },
55     # The main cache invalidation library.  External clients should depend
56     # only on this.
57     {
58       'target_name': 'cacheinvalidation',
59       'type': 'static_library',
60       'sources': [
61         'overrides/google/cacheinvalidation/deps/callback.h',
62         'overrides/google/cacheinvalidation/deps/gmock.h',
63         'overrides/google/cacheinvalidation/deps/googletest.h',
64         'overrides/google/cacheinvalidation/deps/logging.h',
65         'overrides/google/cacheinvalidation/deps/mutex.h',
66         'overrides/google/cacheinvalidation/deps/random.h',
67         'overrides/google/cacheinvalidation/deps/random.cc',
68         'overrides/google/cacheinvalidation/deps/sha1-digest-function.h',
69         'overrides/google/cacheinvalidation/deps/scoped_ptr.h',
70         'overrides/google/cacheinvalidation/deps/stl-namespace.h',
71         'overrides/google/cacheinvalidation/deps/string_util.h',
72         'overrides/google/cacheinvalidation/deps/time.h',
73         'src/google/cacheinvalidation/deps/digest-function.h',
74         'src/google/cacheinvalidation/impl/basic-system-resources.cc',
75         'src/google/cacheinvalidation/impl/basic-system-resources.h',
76         'src/google/cacheinvalidation/impl/checking-invalidation-listener.cc',
77         'src/google/cacheinvalidation/impl/checking-invalidation-listener.h',
78         'src/google/cacheinvalidation/impl/client-protocol-namespace-fix.h',
79         'src/google/cacheinvalidation/impl/constants.cc',
80         'src/google/cacheinvalidation/impl/constants.h',
81         'src/google/cacheinvalidation/impl/digest-store.h',
82         'src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.cc',
83         'src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.h',
84         'src/google/cacheinvalidation/impl/invalidation-client-core.cc',
85         'src/google/cacheinvalidation/impl/invalidation-client-core.h',
86         'src/google/cacheinvalidation/impl/invalidation-client-factory.cc',
87         'src/google/cacheinvalidation/impl/invalidation-client-impl.cc',
88         'src/google/cacheinvalidation/impl/invalidation-client-impl.h',
89         'src/google/cacheinvalidation/impl/invalidation-client-util.h',
90         'src/google/cacheinvalidation/impl/log-macro.h',
91         'src/google/cacheinvalidation/impl/object-id-digest-utils.cc',
92         'src/google/cacheinvalidation/impl/object-id-digest-utils.h',
93         'src/google/cacheinvalidation/impl/persistence-utils.cc',
94         'src/google/cacheinvalidation/impl/persistence-utils.h',
95         'src/google/cacheinvalidation/impl/proto-converter.cc',
96         'src/google/cacheinvalidation/impl/proto-converter.h',
97         'src/google/cacheinvalidation/impl/proto-helpers.h',
98         'src/google/cacheinvalidation/impl/proto-helpers.cc',
99         'src/google/cacheinvalidation/impl/protocol-handler.cc',
100         'src/google/cacheinvalidation/impl/protocol-handler.h',
101         'src/google/cacheinvalidation/impl/recurring-task.cc',
102         'src/google/cacheinvalidation/impl/recurring-task.h',
103         'src/google/cacheinvalidation/impl/registration-manager.cc',
104         'src/google/cacheinvalidation/impl/registration-manager.h',
105         'src/google/cacheinvalidation/impl/repeated-field-namespace-fix.h',
106         'src/google/cacheinvalidation/impl/run-state.h',
107         'src/google/cacheinvalidation/impl/safe-storage.cc',
108         'src/google/cacheinvalidation/impl/safe-storage.h',
109         'src/google/cacheinvalidation/impl/simple-registration-store.cc',
110         'src/google/cacheinvalidation/impl/simple-registration-store.h',
111         'src/google/cacheinvalidation/impl/smearer.h',
112         'src/google/cacheinvalidation/impl/statistics.cc',
113         'src/google/cacheinvalidation/impl/statistics.h',
114         'src/google/cacheinvalidation/impl/throttle.cc',
115         'src/google/cacheinvalidation/impl/throttle.h',
116         'src/google/cacheinvalidation/impl/ticl-message-validator.cc',
117         'src/google/cacheinvalidation/impl/ticl-message-validator.h',
118         'src/google/cacheinvalidation/include/invalidation-client.h',
119         'src/google/cacheinvalidation/include/invalidation-client-factory.h',
120         'src/google/cacheinvalidation/include/invalidation-listener.h',
121         'src/google/cacheinvalidation/include/system-resources.h',
122         'src/google/cacheinvalidation/include/types.h',
123       ],
124       'include_dirs': [
125         './overrides',
126         './src',
127       ],
128       'dependencies': [
129         '../../base/base.gyp:base',
130         'cacheinvalidation_proto_cpp',
131       ],
132       'direct_dependent_settings': {
133         'include_dirs': [
134           './overrides',
135           './src',
136         ],
137       },
138       # We avoid including header files from
139       # cacheinvalidation_proto_cpp in our public header files so we
140       # don't need to export its settings.
141       'export_dependent_settings': [
142         '../../base/base.gyp:base',
143       ],
144       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
145       'msvs_disabled_warnings': [4267, ],
146     },
147     # Unittests for the cache invalidation library.
148     # TODO(ghc): Write native tests and include them here.
149     {
150       'target_name': 'cacheinvalidation_unittests',
151       'type': 'executable',
152       'sources': [
153         'src/google/cacheinvalidation/test/deterministic-scheduler.cc',
154         'src/google/cacheinvalidation/test/deterministic-scheduler.h',
155         'src/google/cacheinvalidation/test/test-logger.cc',
156         'src/google/cacheinvalidation/test/test-logger.h',
157         'src/google/cacheinvalidation/test/test-utils.cc',
158         'src/google/cacheinvalidation/test/test-utils.h',
159         'src/google/cacheinvalidation/impl/invalidation-client-impl_test.cc',
160         'src/google/cacheinvalidation/impl/protocol-handler_test.cc',
161         'src/google/cacheinvalidation/impl/recurring-task_test.cc',
162         'src/google/cacheinvalidation/impl/throttle_test.cc',
163       ],
164       'dependencies': [
165         '../../base/base.gyp:base',
166         '../../base/base.gyp:run_all_unittests',
167         '../../testing/gmock.gyp:gmock',
168         '../../testing/gtest.gyp:gtest',
169         'cacheinvalidation',
170         'cacheinvalidation_proto_cpp',
171       ],
172     },
173   ],
174   'conditions': [
175     ['test_isolation_mode != "noop"', {
176       'targets': [
177         {
178           'target_name': 'cacheinvalidation_unittests_run',
179           'type': 'none',
180           'dependencies': [
181             'cacheinvalidation_unittests',
182           ],
183           'includes': [
184             '../../build/isolate.gypi',
185             'cacheinvalidation_unittests.isolate',
186           ],
187           'sources': [
188             'cacheinvalidation_unittests.isolate',
189           ],
190         },
191       ],
192     }],
193     ['OS == "android"', {
194       'variables': {
195         'emma_never_instrument': 1,
196       },
197       'targets': [
198         {
199           'target_name': 'cacheinvalidation_proto_java',
200           'type': 'none',
201           'variables': {
202             'proto_in_dir': '../../third_party/cacheinvalidation/src/proto',
203           },
204           'sources': [
205             '<(proto_in_dir)/android_channel.proto',
206             '<(proto_in_dir)/android_listener.proto',
207             '<(proto_in_dir)/android_service.proto',
208             '<(proto_in_dir)/android_state.proto',
209             '<(proto_in_dir)/channel_common.proto',
210             '<(proto_in_dir)/client.proto',
211             '<(proto_in_dir)/client_protocol.proto',
212             '<(proto_in_dir)/java_client.proto',
213             '<(proto_in_dir)/types.proto',
214           ],
215           'includes': [ '../../build/protoc_java.gypi' ],
216         },
217         {
218           'target_name': 'cacheinvalidation_example_proto_java',
219           'type': 'none',
220           'variables': {
221             'cacheinvalidation_in_dir': '../../third_party/cacheinvalidation/src',
222             'proto_in_dir' : '<(cacheinvalidation_in_dir)/java/com/google/ipc/invalidation/examples/android2',
223           },
224           'sources': [
225             '<(proto_in_dir)/example_listener.proto',
226           ],
227           'includes': [ '../../build/protoc_java.gypi' ],
228         },
229         {
230           'target_name': 'cacheinvalidation_javalib',
231           'type': 'none',
232           'dependencies': [
233             '../../third_party/android_tools/android_tools.gyp:android_gcm',
234             '../../third_party/guava/guava.gyp:guava_javalib',
235             'cacheinvalidation_aidl_javalib',
236             'cacheinvalidation_example_proto_java',
237             'cacheinvalidation_proto_java',
238           ],
239           'variables': {
240             'java_in_dir': '../../build/android/empty',
241             'additional_src_dirs': [ 'src/java/' ],
242           },
243           'includes': [ '../../build/java.gypi' ],
244         },
245         {
246           'target_name': 'cacheinvalidation_aidl_javalib',
247           'type': 'none',
248           'variables': {
249             # TODO(shashishekhar): aidl_interface_file should be made optional.
250             'aidl_interface_file':'<(android_sdk)/framework.aidl'
251           },
252           'sources': [
253             'src/java/com/google/ipc/invalidation/external/client/android/service/InvalidationService.aidl',
254             'src/java/com/google/ipc/invalidation/external/client/android/service/ListenerService.aidl',
255             'src/java/com/google/ipc/invalidation/testing/android/InvalidationTest.aidl',
256           ],
257           'includes': [ '../../build/java_aidl.gypi' ],
258         },
259       ],
260     }],
261   ],