Cleanup: Consolidate initialization of Android's SecureRandom class.
[chromium-blink-merge.git] / mojo / mojo_base.gyp
blob03614dfaea1dd28aead967a5ba152e17e1833fee
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 # Essential components (and their tests) that are needed to build
6 # Chrome should be here.  Other components that are useful only in
7 # Mojo land like mojo_shell should be in mojo.gyp.
9   'includes': [
10     'mojo_variables.gypi',
11   ],
12   'targets': [
13     {
14       'target_name': 'mojo_base',
15       'type': 'none',
16       'dependencies': [
17         # NOTE: If adding a new dependency here, please consider whether it
18         # should also be added to the list of Mojo-related dependencies of
19         # build/all.gyp:All on iOS, as All cannot depend on the mojo_base
20         # target on iOS due to the presence of the js targets, which cause v8
21         # to be built.
22         'mojo_common_lib',
23         'mojo_common_unittests',
24         'mojo_message_generator',
25       ],
26       'conditions': [
27         ['OS == "android"', {
28           'dependencies': [
29             'libmojo_system_java',
30             'mojo_system_java',
31             'mojo_test_apk',
32             'public/mojo_public.gyp:mojo_bindings_java',
33             'public/mojo_public.gyp:mojo_public_java',
34           ],
35         }],
36       ]
37     },
38     {
39       'target_name': 'mojo_none',
40       'type': 'none',
41     },
42     {
43       # GN version: //mojo/common
44       'target_name': 'mojo_common_lib',
45       'type': '<(component)',
46       'defines': [
47         'MOJO_COMMON_IMPLEMENTATION',
48       ],
49       'dependencies': [
50         '../base/base.gyp:base',
51         '../url/url.gyp:url_lib',
52         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
53         '<(mojo_system_for_component)',
54       ],
55       'export_dependent_settings': [
56         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
57       ],
58       'sources': [
59         'common/common_type_converters.cc',
60         'common/common_type_converters.h',
61         'common/data_pipe_utils.cc',
62         'common/data_pipe_utils.h',
63         'common/handle_watcher.cc',
64         'common/handle_watcher.h',
65         'common/message_pump_mojo.cc',
66         'common/message_pump_mojo.h',
67         'common/message_pump_mojo_handler.h',
68         'common/time_helper.cc',
69         'common/time_helper.h',
70       ],
71     },
72     {
73       # GN version: //mojo/common:mojo_common_unittests
74       'target_name': 'mojo_common_unittests',
75       'type': 'executable',
76       'dependencies': [
77         '../base/base.gyp:base',
78         '../base/base.gyp:base_message_loop_tests',
79         '../testing/gtest.gyp:gtest',
80         '../url/url.gyp:url_lib',
81         'edk/mojo_edk.gyp:mojo_common_test_support',
82         'edk/mojo_edk.gyp:mojo_run_all_unittests',
83         'mojo_common_lib',
84         'mojo_environment_chromium',
85         'public/mojo_public.gyp:mojo_cpp_bindings',
86         'public/mojo_public.gyp:mojo_public_test_utils',
87       ],
88       'sources': [
89         'common/common_type_converters_unittest.cc',
90         'common/handle_watcher_unittest.cc',
91         'common/message_pump_mojo_unittest.cc',
92         'edk/test/multiprocess_test_helper_unittest.cc',
93       ],
94       'conditions': [
95         ['OS=="ios"', {
96           'sources!': [
97             'edk/test/multiprocess_test_helper_unittest.cc',
98           ],
99         }],
100       ],
101     },
102     {
103       # GN version: //mojo/environment:chromium
104       'target_name': 'mojo_environment_chromium',
105       'type': 'static_library',
106       'dependencies': [
107         'mojo_environment_chromium_impl',
108       ],
109       'sources': [
110         'environment/environment.cc',
111         # TODO(vtl): This is kind of ugly. (See TODO in logging.h.)
112         "public/cpp/environment/logging.h",
113         "public/cpp/environment/lib/logging.cc",
114       ],
115       'include_dirs': [
116         '..',
117       ],
118       'export_dependent_settings': [
119         'mojo_environment_chromium_impl',
120       ],
121     },
122     {
123       # GN version: //mojo/environment:chromium_impl
124       'target_name': 'mojo_environment_chromium_impl',
125       'type': '<(component)',
126       'defines': [
127         'MOJO_ENVIRONMENT_IMPL_IMPLEMENTATION',
128       ],
129       'dependencies': [
130         '../base/base.gyp:base',
131         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
132         'mojo_common_lib',
133         '<(mojo_system_for_component)',
134       ],
135       'sources': [
136         'environment/default_async_waiter_impl.cc',
137         'environment/default_async_waiter_impl.h',
138         'environment/default_logger_impl.cc',
139         'environment/default_logger_impl.h',
140       ],
141       'include_dirs': [
142         '..',
143       ],
144     },
145     {
146      # GN version: //mojo/application
147      'target_name': 'mojo_application_chromium',
148      'type': 'static_library',
149      'sources': [
150        'application/application_runner_chromium.cc',
151        'application/application_runner_chromium.h',
152       ],
153       'dependencies': [
154         'mojo_common_lib',
155         'mojo_environment_chromium',
156         'public/mojo_public.gyp:mojo_application_base',
157        ],
158       'export_dependent_settings': [
159         'public/mojo_public.gyp:mojo_application_base',
160        ],
161     },
162     {
163       # GN version: //mojo/bindings/js
164       'target_name': 'mojo_js_bindings_lib',
165       'type': 'static_library',
166       'dependencies': [
167         '../base/base.gyp:base',
168         '../gin/gin.gyp:gin',
169         '../v8/tools/gyp/v8.gyp:v8',
170         'mojo_common_lib',
171       ],
172       'export_dependent_settings': [
173         '../base/base.gyp:base',
174         '../gin/gin.gyp:gin',
175         'mojo_common_lib',
176       ],
177       'sources': [
178         # Sources list duplicated in GN build.
179         'bindings/js/core.cc',
180         'bindings/js/core.h',
181         'bindings/js/drain_data.cc',
182         'bindings/js/drain_data.h',
183         'bindings/js/handle.cc',
184         'bindings/js/handle.h',
185         'bindings/js/handle_close_observer.h',
186         'bindings/js/support.cc',
187         'bindings/js/support.h',
188         'bindings/js/waiting_callback.cc',
189         'bindings/js/waiting_callback.h',
190       ],
191     },
192     {
193       # GN version: //mojo/tools:message_generator
194       'target_name': 'mojo_message_generator',
195       'type': 'executable',
196       'dependencies': [
197         '../base/base.gyp:base',
198         '../testing/gtest.gyp:gtest',
199         'edk/mojo_edk.gyp:mojo_system_impl',
200         'mojo_common_lib',
201         'mojo_environment_chromium',
202         'public/mojo_public.gyp:mojo_cpp_bindings',
203       ],
204       'sources': [
205         'tools/message_generator.cc',
206       ],
207     },
208   ],
209   'conditions': [
210     ['OS=="android"', {
211       'targets': [
212         {
213           'target_name': 'mojo_jni_headers',
214           'type': 'none',
215           'dependencies': [
216             'mojo_java_set_jni_headers',
217           ],
218           'sources': [
219             'android/javatests/src/org/chromium/mojo/MojoTestCase.java',
220             'android/javatests/src/org/chromium/mojo/bindings/ValidationTestUtil.java',
221             'android/system/src/org/chromium/mojo/system/impl/CoreImpl.java',
222             'services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java',
223             'shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java',
224           ],
225           'variables': {
226             'jni_gen_package': 'mojo',
227          },
228           'includes': [ '../build/jni_generator.gypi' ],
229         },
230         {
231           'target_name': 'mojo_java_set_jni_headers',
232           'type': 'none',
233           'variables': {
234             'jni_gen_package': 'mojo',
235             'input_java_class': 'java/util/HashSet.class',
236           },
237           'includes': [ '../build/jar_file_jni_generator.gypi' ],
238         },
239         {
240           'target_name': 'mojo_system_java',
241           'type': 'none',
242           'dependencies': [
243             '../base/base.gyp:base_java',
244             'libmojo_system_java',
245             'public/mojo_public.gyp:mojo_public_java',
246           ],
247           'variables': {
248             'java_in_dir': '<(DEPTH)/mojo/android/system',
249           },
250           'includes': [ '../build/java.gypi' ],
251         },
252         {
253           'target_name': 'libmojo_system_java',
254           'type': 'static_library',
255           'dependencies': [
256             '../base/base.gyp:base',
257             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
258             'edk/mojo_edk.gyp:mojo_system_impl',
259             'mojo_common_lib',
260             'mojo_environment_chromium',
261             'mojo_jni_headers',
262           ],
263           'sources': [
264             'android/system/core_impl.cc',
265             'android/system/core_impl.h',
266           ],
267         },
268         {
269           'target_name': 'libmojo_java_unittest',
270           'type': 'shared_library',
271           'dependencies': [
272             '../base/base.gyp:base',
273             '../base/base.gyp:test_support_base',
274             'libmojo_system_java',
275             'mojo_jni_headers',
276             'public/mojo_public.gyp:mojo_public_bindings_test_utils',
277           ],
278           'defines': [
279             'UNIT_TEST'  # As exported from testing/gtest.gyp:gtest.
280           ],
281           'sources': [
282             'android/javatests/mojo_test_case.cc',
283             'android/javatests/mojo_test_case.h',
284             'android/javatests/init_library.cc',
285             'android/javatests/validation_test_util.cc',
286             'android/javatests/validation_test_util.h',
287           ],
288         },
289         {
290           'target_name': 'mojo_test_apk',
291           'type': 'none',
292           'dependencies': [
293             '../base/base.gyp:base_java_test_support',
294             'public/mojo_public.gyp:mojo_bindings_java',
295             'mojo_system_java',
296             'public/mojo_public.gyp:mojo_public_test_interfaces',
297           ],
298           'variables': {
299             'apk_name': 'MojoTest',
300             'java_in_dir': '<(DEPTH)/mojo/android/javatests',
301             'resource_dir': '<(DEPTH)/mojo/android/javatests/apk',
302             'native_lib_target': 'libmojo_java_unittest',
303             'is_test_apk': 1,
304             # Given that this apk tests itself, it needs to bring emma with it
305             # when instrumented.
306             'conditions': [
307               ['emma_coverage != 0', {
308                 'emma_instrument': 1,
309               }],
310             ],
311           },
312           'includes': [ '../build/java_apk.gypi' ],
313         },
314       ]
315     }],
316   ]