Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / cacheinvalidation / BUILD.gn
blobdbcae8a8de8390c924b7ed331c163af53a599944
1 # Copyright 2014 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.
5 import("//testing/test.gni")
7 config("cacheinvalidation_config") {
8   include_dirs = [
9     "overrides",
10     "src",
11   ]
14 static_library("cacheinvalidation") {
15   sources = [
16     "overrides/google/cacheinvalidation/deps/callback.h",
17     "overrides/google/cacheinvalidation/deps/gmock.h",
18     "overrides/google/cacheinvalidation/deps/googletest.h",
19     "overrides/google/cacheinvalidation/deps/logging.h",
20     "overrides/google/cacheinvalidation/deps/mutex.h",
21     "overrides/google/cacheinvalidation/deps/random.cc",
22     "overrides/google/cacheinvalidation/deps/random.h",
23     "overrides/google/cacheinvalidation/deps/scoped_ptr.h",
24     "overrides/google/cacheinvalidation/deps/sha1-digest-function.h",
25     "overrides/google/cacheinvalidation/deps/stl-namespace.h",
26     "overrides/google/cacheinvalidation/deps/string_util.h",
27     "overrides/google/cacheinvalidation/deps/time.h",
28     "src/google/cacheinvalidation/deps/digest-function.h",
29     "src/google/cacheinvalidation/impl/basic-system-resources.cc",
30     "src/google/cacheinvalidation/impl/basic-system-resources.h",
31     "src/google/cacheinvalidation/impl/checking-invalidation-listener.cc",
32     "src/google/cacheinvalidation/impl/checking-invalidation-listener.h",
33     "src/google/cacheinvalidation/impl/client-protocol-namespace-fix.h",
34     "src/google/cacheinvalidation/impl/constants.cc",
35     "src/google/cacheinvalidation/impl/constants.h",
36     "src/google/cacheinvalidation/impl/digest-store.h",
37     "src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.cc",
38     "src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.h",
39     "src/google/cacheinvalidation/impl/invalidation-client-core.cc",
40     "src/google/cacheinvalidation/impl/invalidation-client-core.h",
41     "src/google/cacheinvalidation/impl/invalidation-client-factory.cc",
42     "src/google/cacheinvalidation/impl/invalidation-client-impl.cc",
43     "src/google/cacheinvalidation/impl/invalidation-client-impl.h",
44     "src/google/cacheinvalidation/impl/invalidation-client-util.h",
45     "src/google/cacheinvalidation/impl/log-macro.h",
46     "src/google/cacheinvalidation/impl/object-id-digest-utils.cc",
47     "src/google/cacheinvalidation/impl/object-id-digest-utils.h",
48     "src/google/cacheinvalidation/impl/persistence-utils.cc",
49     "src/google/cacheinvalidation/impl/persistence-utils.h",
50     "src/google/cacheinvalidation/impl/proto-converter.cc",
51     "src/google/cacheinvalidation/impl/proto-converter.h",
52     "src/google/cacheinvalidation/impl/proto-helpers.cc",
53     "src/google/cacheinvalidation/impl/proto-helpers.h",
54     "src/google/cacheinvalidation/impl/protocol-handler.cc",
55     "src/google/cacheinvalidation/impl/protocol-handler.h",
56     "src/google/cacheinvalidation/impl/recurring-task.cc",
57     "src/google/cacheinvalidation/impl/recurring-task.h",
58     "src/google/cacheinvalidation/impl/registration-manager.cc",
59     "src/google/cacheinvalidation/impl/registration-manager.h",
60     "src/google/cacheinvalidation/impl/repeated-field-namespace-fix.h",
61     "src/google/cacheinvalidation/impl/run-state.h",
62     "src/google/cacheinvalidation/impl/safe-storage.cc",
63     "src/google/cacheinvalidation/impl/safe-storage.h",
64     "src/google/cacheinvalidation/impl/simple-registration-store.cc",
65     "src/google/cacheinvalidation/impl/simple-registration-store.h",
66     "src/google/cacheinvalidation/impl/smearer.h",
67     "src/google/cacheinvalidation/impl/statistics.cc",
68     "src/google/cacheinvalidation/impl/statistics.h",
69     "src/google/cacheinvalidation/impl/throttle.cc",
70     "src/google/cacheinvalidation/impl/throttle.h",
71     "src/google/cacheinvalidation/impl/ticl-message-validator.cc",
72     "src/google/cacheinvalidation/impl/ticl-message-validator.h",
73     "src/google/cacheinvalidation/include/invalidation-client-factory.h",
74     "src/google/cacheinvalidation/include/invalidation-client.h",
75     "src/google/cacheinvalidation/include/invalidation-listener.h",
76     "src/google/cacheinvalidation/include/system-resources.h",
77     "src/google/cacheinvalidation/include/types.h",
78   ]
80   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
81   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
82   public_configs = [ ":cacheinvalidation_config" ]
84   public_deps = [
85     "src/google/cacheinvalidation:cacheinvalidation_proto_cpp",
86   ]
88   deps = [
89     "//base",
90   ]
93 # TODO(GYP): Delete this after we've converted everything to GN.
94 # The _run targets exist only for compatibility w/ GYP.
95 group("cacheinvalidation_unittests_run") {
96   testonly = true
97   deps = [
98     ":cacheinvalidation_unittests",
99   ]
102 test("cacheinvalidation_unittests") {
103   sources = [
104     "src/google/cacheinvalidation/impl/invalidation-client-impl_test.cc",
105     "src/google/cacheinvalidation/impl/protocol-handler_test.cc",
106     "src/google/cacheinvalidation/impl/recurring-task_test.cc",
107     "src/google/cacheinvalidation/impl/throttle_test.cc",
108     "src/google/cacheinvalidation/test/deterministic-scheduler.cc",
109     "src/google/cacheinvalidation/test/deterministic-scheduler.h",
110     "src/google/cacheinvalidation/test/test-logger.cc",
111     "src/google/cacheinvalidation/test/test-logger.h",
112     "src/google/cacheinvalidation/test/test-utils.cc",
113     "src/google/cacheinvalidation/test/test-utils.h",
114   ]
116   deps = [
117     ":cacheinvalidation",
118     "src/google/cacheinvalidation:cacheinvalidation_proto_cpp",
119     "//base",
120     "//base/test:run_all_unittests",
121     "//testing/gmock",
122     "//testing/gtest",
123   ]
126 # TODO(GYP) Test isolation stuff.
127 if (is_android) {
128   import("//build/config/android/rules.gni")
130   # GYP: //third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_java
131   proto_java_library("cacheinvalidation_proto_java") {
132     proto_path = "src/proto"
133     sources = [
134       "$proto_path/android_channel.proto",
135       "$proto_path/android_listener.proto",
136       "$proto_path/android_service.proto",
137       "$proto_path/channel_common.proto",
138       "$proto_path/client.proto",
139       "$proto_path/client_protocol.proto",
140       "$proto_path/java_client.proto",
141       "$proto_path/types.proto",
142     ]
143   }
145   # GYP: //third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib
146   android_library("cacheinvalidation_javalib") {
147     deps = [
148       ":cacheinvalidation_proto_java",
149       "//third_party/android_protobuf:protobuf_nano_javalib",
150       "//third_party/android_tools:android_gcm_java",
151       google_play_services_library,
152     ]
154     DEPRECATED_java_in_dir = "src/java"
155   }