Disable flaky UnloadTest.CrossSiteInfiniteBeforeUnloadSync on Mac.
[chromium-blink-merge.git] / device / battery / battery.gyp
blobb5c55b03ae42a4efacc26ecb72b80b6375cb0bfa
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.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       # GN version: //device/battery:battery_mojo
12       'target_name': 'device_battery_mojo_bindings',
13       'type': 'static_library',
14       'includes': [
15         '../../third_party/mojo/mojom_bindings_generator.gypi',
16       ],
17       'sources': [
18         'battery_monitor.mojom',
19         'battery_status.mojom',
20       ],
21     },
22     {
23       # This is needed only for a build within Android tree. TODO(ppi): remove
24       # when Android tree build is deprecated.
25       'target_name': 'device_battery_mojo_bindings_for_webview',
26       'type': 'none',
27       'dependencies': [
28         'device_battery_mojo_bindings',
29       ],
30       'actions': [
31         {
32           # Dummy action that triggers the bindings generation and explicitly
33           # declares the java outputs, so that they are discoverable to make.
34           'action_name': 'device_battery_mojo_bindings_dummy_action',
35           'inputs': [
36             '<(SHARED_INTERMEDIATE_DIR)/device/battery/battery_monitor.mojom.h',
37             '<(SHARED_INTERMEDIATE_DIR)/device/battery/battery_status.mojom.h',
38           ],
39           'outputs': [
40             '<(SHARED_INTERMEDIATE_DIR)/java_mojo/device_battery_mojo_bindings/src/org/chromium/mojom/device/BatteryMonitor.java',
41             '<(SHARED_INTERMEDIATE_DIR)/java_mojo/device_battery_mojo_bindings/src/org/chromium/mojom/device/BatteryMonitor_Internal.java',
42             '<(SHARED_INTERMEDIATE_DIR)/java_mojo/device_battery_mojo_bindings/src/org/chromium/mojom/device/BatteryStatusObserver.java',
43             '<(SHARED_INTERMEDIATE_DIR)/java_mojo/device_battery_mojo_bindings/src/org/chromium/mojom/device/BatteryStatusObserver_Internal.java',
44             '<(SHARED_INTERMEDIATE_DIR)/java_mojo/device_battery_mojo_bindings/src/org/chromium/mojom/device/BatteryStatus.java',
45           ],
46           'action': ['touch', '<@(_outputs)'],
47         },
48       ],
49       'hard_dependency': 1,
50     },
51     {
52       # GN version: //device/battery
53       'target_name': 'device_battery',
54       'type': '<(component)',
55       'dependencies': [
56         '../../base/base.gyp:base',
57         '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
58         '../../mojo/mojo_base.gyp:mojo_environment_chromium',
59         '../../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
60         '../../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
61         'device_battery_mojo_bindings',
62       ],
63       'defines': [
64         'DEVICE_BATTERY_IMPLEMENTATION',
65       ],
66       'sources': [
67         'battery_monitor_impl.cc',
68         'battery_monitor_impl.h',
69         'battery_status_manager_chromeos.cc',
70         'battery_status_manager_default.cc',
71         'battery_status_manager_linux.cc',
72         'battery_status_manager_linux.h',
73         'battery_status_manager_mac.cc',
74         'battery_status_manager_win.cc',
75         'battery_status_manager_win.h',
76         'battery_status_manager.h',
77         'battery_status_service.cc',
78         'battery_status_service.h',
79       ],
80       'conditions': [
81         ['chromeos==1', {
82           'dependencies': [
83             '../../build/linux/system.gyp:dbus',
84             '../../chromeos/chromeos.gyp:chromeos',
85             '../../chromeos/chromeos.gyp:power_manager_proto',
86           ],
87           'sources!': [
88             'battery_status_manager_default.cc',
89             'battery_status_manager_linux.cc',
90           ],
91         }],
92         ['OS == "linux" and use_dbus==1', {
93           'sources!': [
94             'battery_status_manager_default.cc',
95           ],
96           'dependencies': [
97             '../../build/linux/system.gyp:dbus',
98             '../../dbus/dbus.gyp:dbus',
99           ],
100         }, {  # OS != "linux" or use_dbus==0
101           'sources!': [
102             'battery_status_manager_linux.cc',
103           ],
104         }],
105         ['OS == "mac"', {
106           'sources!': [
107             'battery_status_manager_default.cc',
108           ],
109         }],
110         ['OS == "win"', {
111           'sources!': [
112             'battery_status_manager_default.cc',
113           ],
114         }],
115       ],
116     },
117   ],
118   'conditions': [
119     ['OS == "android"', {
120       'targets': [
121         {
122           'target_name': 'device_battery_java',
123           'type': 'none',
124           'dependencies': [
125             '../../base/base.gyp:base',
126             '../../third_party/mojo/mojo_public.gyp:mojo_bindings_java',
127             'device_battery_mojo_bindings',
128           ],
129           'variables': {
130             'java_in_dir': '../../device/battery/android/java',
131           },
132           'includes': [ '../../build/java.gypi' ],
133         },
134         {
135           'target_name': 'device_battery_javatests',
136           'type': 'none',
137           'variables': {
138             'java_in_dir': '../../device/battery/android/javatests',
139           },
140           'dependencies': [
141             '../../base/base.gyp:base',
142             '../../base/base.gyp:base_java_test_support',
143             'device_battery_java',
144           ],
145           'includes': [ '../../build/java.gypi' ],
146         },
147       ],
148     }],
149   ],