Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / third_party / cacheinvalidation / cacheinvalidation.gyp
blob1fcb28ada48f87dc469b2253b23eedf906a30674
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)/client.proto',
28         '<(proto_in_dir)/client_gateway.proto',
29         '<(proto_in_dir)/client_protocol.proto',
30         '<(proto_in_dir)/client_test_internal.proto',
31         '<(proto_in_dir)/types.proto',
32       ],
33       'includes': [ '../../build/protoc.gypi' ],
34       'direct_dependent_settings': {
35         'include_dirs': [
36           '<(proto_out_dir)',
37         ],
38       },
39       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
40       'msvs_disabled_warnings': [4267, ],
41     },
42     # The main cache invalidation library.  External clients should depend
43     # only on this.
44     {
45       'target_name': 'cacheinvalidation',
46       'type': 'static_library',
47       'sources': [
48         'overrides/google/cacheinvalidation/deps/callback.h',
49         'overrides/google/cacheinvalidation/deps/gmock.h',
50         'overrides/google/cacheinvalidation/deps/googletest.h',
51         'overrides/google/cacheinvalidation/deps/logging.h',
52         'overrides/google/cacheinvalidation/deps/mutex.h',
53         'overrides/google/cacheinvalidation/deps/random.h',
54         'overrides/google/cacheinvalidation/deps/sha1-digest-function.h',
55         'overrides/google/cacheinvalidation/deps/scoped_ptr.h',
56         'overrides/google/cacheinvalidation/deps/stl-namespace.h',
57         'overrides/google/cacheinvalidation/deps/string_util.h',
58         'overrides/google/cacheinvalidation/deps/time.h',
59         'src/google/cacheinvalidation/deps/digest-function.h',
60         'src/google/cacheinvalidation/impl/basic-system-resources.cc',
61         'src/google/cacheinvalidation/impl/basic-system-resources.h',
62         'src/google/cacheinvalidation/impl/checking-invalidation-listener.cc',
63         'src/google/cacheinvalidation/impl/checking-invalidation-listener.h',
64         'src/google/cacheinvalidation/impl/client-protocol-namespace-fix.h',
65         'src/google/cacheinvalidation/impl/constants.cc',
66         'src/google/cacheinvalidation/impl/constants.h',
67         'src/google/cacheinvalidation/impl/digest-store.h',
68         'src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.cc',
69         'src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.h',
70         'src/google/cacheinvalidation/impl/invalidation-client-core.cc',
71         'src/google/cacheinvalidation/impl/invalidation-client-core.h',
72         'src/google/cacheinvalidation/impl/invalidation-client-factory.cc',
73         'src/google/cacheinvalidation/impl/invalidation-client-impl.cc',
74         'src/google/cacheinvalidation/impl/invalidation-client-impl.h',
75         'src/google/cacheinvalidation/impl/invalidation-client-util.h',
76         'src/google/cacheinvalidation/impl/log-macro.h',
77         'src/google/cacheinvalidation/impl/object-id-digest-utils.cc',
78         'src/google/cacheinvalidation/impl/object-id-digest-utils.h',
79         'src/google/cacheinvalidation/impl/persistence-utils.cc',
80         'src/google/cacheinvalidation/impl/persistence-utils.h',
81         'src/google/cacheinvalidation/impl/proto-converter.cc',
82         'src/google/cacheinvalidation/impl/proto-converter.h',
83         'src/google/cacheinvalidation/impl/proto-helpers.h',
84         'src/google/cacheinvalidation/impl/proto-helpers.cc',
85         'src/google/cacheinvalidation/impl/protocol-handler.cc',
86         'src/google/cacheinvalidation/impl/protocol-handler.h',
87         'src/google/cacheinvalidation/impl/recurring-task.cc',
88         'src/google/cacheinvalidation/impl/recurring-task.h',
89         'src/google/cacheinvalidation/impl/registration-manager.cc',
90         'src/google/cacheinvalidation/impl/registration-manager.h',
91         'src/google/cacheinvalidation/impl/run-state.h',
92         'src/google/cacheinvalidation/impl/safe-storage.cc',
93         'src/google/cacheinvalidation/impl/safe-storage.h',
94         'src/google/cacheinvalidation/impl/simple-registration-store.cc',
95         'src/google/cacheinvalidation/impl/simple-registration-store.h',
96         'src/google/cacheinvalidation/impl/smearer.h',
97         'src/google/cacheinvalidation/impl/statistics.cc',
98         'src/google/cacheinvalidation/impl/statistics.h',
99         'src/google/cacheinvalidation/impl/throttle.cc',
100         'src/google/cacheinvalidation/impl/throttle.h',
101         'src/google/cacheinvalidation/impl/ticl-message-validator.cc',
102         'src/google/cacheinvalidation/impl/ticl-message-validator.h',
103         'src/google/cacheinvalidation/include/invalidation-client.h',
104         'src/google/cacheinvalidation/include/invalidation-client-factory.h',
105         'src/google/cacheinvalidation/include/invalidation-listener.h',
106         'src/google/cacheinvalidation/include/system-resources.h',
107         'src/google/cacheinvalidation/include/types.h',
108       ],
109       'include_dirs': [
110         './overrides',
111         './src',
112       ],
113       'dependencies': [
114         '../../base/base.gyp:base',
115         'cacheinvalidation_proto_cpp',
116       ],
117       'direct_dependent_settings': {
118         'include_dirs': [
119           './overrides',
120           './src',
121         ],
122       },
123       # We avoid including header files from
124       # cacheinvalidation_proto_cpp in our public header files so we
125       # don't need to export its settings.
126       'export_dependent_settings': [
127         '../../base/base.gyp:base',
128       ],
129       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
130       'msvs_disabled_warnings': [4267, ],
131     },
132     # Unittests for the cache invalidation library.
133     # TODO(ghc): Write native tests and include them here.
134     {
135       'target_name': 'cacheinvalidation_unittests',
136       'type': 'executable',
137       'sources': [
138         'src/google/cacheinvalidation/test/deterministic-scheduler.cc',
139         'src/google/cacheinvalidation/test/deterministic-scheduler.h',
140         'src/google/cacheinvalidation/test/test-logger.cc',
141         'src/google/cacheinvalidation/test/test-logger.h',
142         'src/google/cacheinvalidation/test/test-utils.cc',
143         'src/google/cacheinvalidation/test/test-utils.h',
144         'src/google/cacheinvalidation/impl/invalidation-client-impl_test.cc',
145         'src/google/cacheinvalidation/impl/protocol-handler_test.cc',
146         'src/google/cacheinvalidation/impl/recurring-task_test.cc',
147         'src/google/cacheinvalidation/impl/throttle_test.cc',
148       ],
149       'dependencies': [
150         '../../base/base.gyp:base',
151         '../../base/base.gyp:run_all_unittests',
152         '../../testing/gmock.gyp:gmock',
153         '../../testing/gtest.gyp:gtest',
154         'cacheinvalidation',
155         'cacheinvalidation_proto_cpp',
156       ],
157     },
158   ],
159   'conditions': [
160     ['test_isolation_mode != "noop"', {
161       'targets': [
162         {
163           'target_name': 'cacheinvalidation_unittests_run',
164           'type': 'none',
165           'dependencies': [
166             'cacheinvalidation_unittests',
167           ],
168           'includes': [
169             '../../build/isolate.gypi',
170             'cacheinvalidation_unittests.isolate',
171           ],
172           'sources': [
173             'cacheinvalidation_unittests.isolate',
174           ],
175         },
176       ],
177     }],
178     ['OS == "android"', {
179       'targets': [
180         {
181           'target_name': 'cacheinvalidation_proto_java',
182           'type': 'none',
183           'variables': {
184             'proto_in_dir': '../../third_party/cacheinvalidation/src/proto',
185           },
186           'sources': [
187             '<(proto_in_dir)/android_channel.proto',
188             '<(proto_in_dir)/android_listener.proto',
189             '<(proto_in_dir)/android_service.proto',
190             '<(proto_in_dir)/android_state.proto',
191             '<(proto_in_dir)/channel.proto',
192             '<(proto_in_dir)/channel_common.proto',
193             '<(proto_in_dir)/client.proto',
194             '<(proto_in_dir)/client_protocol.proto',
195             '<(proto_in_dir)/java_client.proto',
196             '<(proto_in_dir)/types.proto',
197           ],
198           'includes': [ '../../build/protoc_java.gypi' ],
199         },
200         {
201           'target_name': 'cacheinvalidation_javalib',
202           'type': 'none',
203           'dependencies': [
204             '../../third_party/android_tools/android_tools.gyp:android_gcm',
205             '../../third_party/guava/guava.gyp:guava_javalib',
206             'cacheinvalidation_aidl_javalib',
207             'cacheinvalidation_proto_java',
208           ],
209           'variables': {
210             'java_in_dir': '../../build/android/empty',
211             'additional_src_dirs': [ 'src/java/' ],
212           },
213           'includes': [ '../../build/java.gypi' ],
214         },
215         {
216           'target_name': 'cacheinvalidation_aidl_javalib',
217           'type': 'none',
218           'variables': {
219             # TODO(shashishekhar): aidl_interface_file should be made optional.
220             'aidl_interface_file':'<(android_sdk)/framework.aidl'
221           },
222           'sources': [
223             'src/java/com/google/ipc/invalidation/external/client/android/service/InvalidationService.aidl',
224             'src/java/com/google/ipc/invalidation/external/client/android/service/ListenerService.aidl',
225             'src/java/com/google/ipc/invalidation/testing/android/InvalidationTest.aidl',
226           ],
227           'includes': [ '../../build/java_aidl.gypi' ],
228         },
229       ],
230     }],
231   ],