1 # Copyright 2013 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.
7 # Included to get 'mac_bundle_id' and other variables.
8 '../build/chrome_settings.gypi',
12 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
13 'policy_out_dir': '<(SHARED_INTERMEDIATE_DIR)/policy',
14 'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
15 'generate_policy_source_script_path':
16 'policy/tools/generate_policy_source.py',
17 'policy_constant_header_path':
18 '<(policy_out_dir)/policy/policy_constants.h',
19 'policy_constant_source_path':
20 '<(policy_out_dir)/policy/policy_constants.cc',
21 'protobuf_decoder_path':
22 '<(policy_out_dir)/policy/cloud_policy_generated.cc',
23 # This is the "full" protobuf, which defines one protobuf message per
24 # policy. It is also the format currently used by the server.
25 'chrome_settings_proto_path':
26 '<(policy_out_dir)/policy/chrome_settings.proto',
27 # This protobuf is equivalent to chrome_settings.proto but shares messages
28 # for policies of the same type, so that less classes have to be generated
30 'cloud_policy_proto_path':
31 '<(policy_out_dir)/policy/cloud_policy.proto',
35 'target_name': 'policy_component',
36 'type': '<(component)',
38 '../base/base.gyp:base',
41 'POLICY_COMPONENT_IMPLEMENTATION',
47 ['configuration_policy==1', {
49 '../base/base.gyp:base_prefs',
50 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
51 '../google_apis/google_apis.gyp:google_apis',
53 '../url/url.gyp:url_lib',
54 'component_strings.gyp:component_strings',
62 'policy/core/browser/cloud/message_util.cc',
63 'policy/core/browser/cloud/message_util.h',
64 'policy/core/browser/configuration_policy_handler.cc',
65 'policy/core/browser/configuration_policy_handler.h',
66 'policy/core/browser/configuration_policy_handler_list.cc',
67 'policy/core/browser/configuration_policy_handler_list.h',
68 'policy/core/browser/configuration_policy_pref_store.cc',
69 'policy/core/browser/configuration_policy_pref_store.h',
70 'policy/core/browser/policy_error_map.cc',
71 'policy/core/browser/policy_error_map.h',
72 'policy/core/common/cloud/cloud_external_data_manager.cc',
73 'policy/core/common/cloud/cloud_external_data_manager.h',
74 'policy/core/common/cloud/cloud_policy_client.cc',
75 'policy/core/common/cloud/cloud_policy_client.h',
76 'policy/core/common/cloud/cloud_policy_client_registration_helper.cc',
77 'policy/core/common/cloud/cloud_policy_client_registration_helper.h',
78 'policy/core/common/cloud/cloud_policy_constants.cc',
79 'policy/core/common/cloud/cloud_policy_constants.h',
80 'policy/core/common/cloud/cloud_policy_core.cc',
81 'policy/core/common/cloud/cloud_policy_core.h',
82 'policy/core/common/cloud/cloud_policy_manager.cc',
83 'policy/core/common/cloud/cloud_policy_manager.h',
84 'policy/core/common/cloud/cloud_policy_refresh_scheduler.cc',
85 'policy/core/common/cloud/cloud_policy_refresh_scheduler.h',
86 'policy/core/common/cloud/cloud_policy_service.cc',
87 'policy/core/common/cloud/cloud_policy_service.h',
88 'policy/core/common/cloud/cloud_policy_store.cc',
89 'policy/core/common/cloud/cloud_policy_store.h',
90 'policy/core/common/cloud/cloud_policy_validator.cc',
91 'policy/core/common/cloud/cloud_policy_validator.h',
92 'policy/core/common/cloud/component_cloud_policy_service.cc',
93 'policy/core/common/cloud/component_cloud_policy_service.h',
94 'policy/core/common/cloud/component_cloud_policy_store.cc',
95 'policy/core/common/cloud/component_cloud_policy_store.h',
96 'policy/core/common/cloud/component_cloud_policy_updater.cc',
97 'policy/core/common/cloud/component_cloud_policy_updater.h',
98 'policy/core/common/cloud/device_management_service.cc',
99 'policy/core/common/cloud/device_management_service.h',
100 'policy/core/common/cloud/enterprise_metrics.cc',
101 'policy/core/common/cloud/enterprise_metrics.h',
102 'policy/core/common/cloud/external_policy_data_fetcher.cc',
103 'policy/core/common/cloud/external_policy_data_fetcher.h',
104 'policy/core/common/cloud/external_policy_data_updater.cc',
105 'policy/core/common/cloud/external_policy_data_updater.h',
106 'policy/core/common/cloud/policy_header_io_helper.cc',
107 'policy/core/common/cloud/policy_header_io_helper.h',
108 'policy/core/common/cloud/policy_header_service.cc',
109 'policy/core/common/cloud/policy_header_service.h',
110 'policy/core/common/cloud/rate_limiter.cc',
111 'policy/core/common/cloud/rate_limiter.h',
112 'policy/core/common/cloud/resource_cache.cc',
113 'policy/core/common/cloud/resource_cache.h',
114 'policy/core/common/cloud/system_policy_request_context.cc',
115 'policy/core/common/cloud/system_policy_request_context.h',
116 'policy/core/common/cloud/user_cloud_policy_manager.cc',
117 'policy/core/common/cloud/user_cloud_policy_manager.h',
118 'policy/core/common/cloud/user_cloud_policy_store.cc',
119 'policy/core/common/cloud/user_cloud_policy_store.h',
120 'policy/core/common/cloud/user_cloud_policy_store_base.cc',
121 'policy/core/common/cloud/user_cloud_policy_store_base.h',
122 'policy/core/common/cloud/user_info_fetcher.cc',
123 'policy/core/common/cloud/user_info_fetcher.h',
124 'policy/core/common/cloud/user_policy_request_context.cc',
125 'policy/core/common/cloud/user_policy_request_context.h',
126 'policy/core/common/async_policy_loader.cc',
127 'policy/core/common/async_policy_loader.h',
128 'policy/core/common/async_policy_provider.cc',
129 'policy/core/common/async_policy_provider.h',
130 'policy/core/common/config_dir_policy_loader.cc',
131 'policy/core/common/config_dir_policy_loader.h',
132 'policy/core/common/configuration_policy_provider.cc',
133 'policy/core/common/configuration_policy_provider.h',
134 'policy/core/common/external_data_fetcher.cc',
135 'policy/core/common/external_data_fetcher.h',
136 'policy/core/common/external_data_manager.h',
137 'policy/core/common/forwarding_policy_provider.cc',
138 'policy/core/common/forwarding_policy_provider.h',
139 'policy/core/common/policy_bundle.cc',
140 'policy/core/common/policy_bundle.h',
141 'policy/core/common/policy_details.h',
142 'policy/core/common/policy_loader_mac.cc',
143 'policy/core/common/policy_loader_mac.h',
144 'policy/core/common/policy_loader_win.cc',
145 'policy/core/common/policy_loader_win.h',
146 'policy/core/common/policy_load_status.cc',
147 'policy/core/common/policy_load_status.h',
148 'policy/core/common/policy_map.cc',
149 'policy/core/common/policy_map.h',
150 'policy/core/common/policy_namespace.cc',
151 'policy/core/common/policy_namespace.h',
152 'policy/core/common/policy_pref_names.cc',
153 'policy/core/common/policy_pref_names.h',
154 'policy/core/common/policy_service.cc',
155 'policy/core/common/policy_service.h',
156 'policy/core/common/policy_service_impl.cc',
157 'policy/core/common/policy_service_impl.h',
158 'policy/core/common/policy_statistics_collector.cc',
159 'policy/core/common/policy_statistics_collector.h',
160 'policy/core/common/policy_switches.cc',
161 'policy/core/common/policy_switches.h',
162 'policy/core/common/policy_types.h',
163 'policy/core/common/preferences_mac.cc',
164 'policy/core/common/preferences_mac.h',
165 'policy/core/common/preg_parser_win.cc',
166 'policy/core/common/preg_parser_win.h',
167 'policy/core/common/registry_dict_win.cc',
168 'policy/core/common/registry_dict_win.h',
169 'policy/core/common/schema.cc',
170 'policy/core/common/schema.h',
171 'policy/core/common/schema_internal.h',
172 'policy/core/common/schema_map.cc',
173 'policy/core/common/schema_map.h',
174 'policy/core/common/schema_registry.cc',
175 'policy/core/common/schema_registry.h',
176 'policy/core/common/url_blacklist_manager.cc',
177 'policy/core/common/url_blacklist_manager.h',
178 'policy/policy_export.h',
183 'policy/core/common/cloud/component_cloud_policy_service_stub.cc',
186 'policy/core/common/async_policy_loader.cc',
187 'policy/core/common/async_policy_loader.h',
188 'policy/core/common/async_policy_provider.cc',
189 'policy/core/common/async_policy_provider.h',
190 'policy/core/common/cloud/component_cloud_policy_service.cc',
191 'policy/core/common/cloud/component_cloud_policy_store.cc',
192 'policy/core/common/cloud/component_cloud_policy_store.h',
193 'policy/core/common/cloud/component_cloud_policy_updater.cc',
194 'policy/core/common/cloud/component_cloud_policy_updater.h',
195 'policy/core/common/cloud/external_policy_data_fetcher.cc',
196 'policy/core/common/cloud/external_policy_data_fetcher.h',
197 'policy/core/common/cloud/external_policy_data_updater.cc',
198 'policy/core/common/cloud/external_policy_data_updater.h',
199 'policy/core/common/cloud/resource_cache.cc',
200 'policy/core/common/cloud/resource_cache.h',
201 'policy/core/common/config_dir_policy_loader.cc',
202 'policy/core/common/config_dir_policy_loader.h',
203 'policy/core/common/policy_load_status.cc',
204 'policy/core/common/policy_load_status.h',
209 'policy/core/common/cloud/cloud_policy_client_registration_helper.cc',
210 'policy/core/common/cloud/cloud_policy_client_registration_helper.h',
211 'policy/core/common/cloud/user_cloud_policy_manager.cc',
212 'policy/core/common/cloud/user_cloud_policy_manager.h',
213 'policy/core/common/cloud/user_cloud_policy_store.cc',
214 'policy/core/common/cloud/user_cloud_policy_store.h',
218 }, { # configuration_policy==0
219 # Some of the policy code is always enabled, so that other parts of
220 # Chrome can always interface with the PolicyService without having
221 # to #ifdef on ENABLE_CONFIGURATION_POLICY.
223 'policy/core/common/external_data_fetcher.h',
224 'policy/core/common/external_data_fetcher.cc',
225 'policy/core/common/external_data_manager.h',
226 'policy/core/common/policy_map.cc',
227 'policy/core/common/policy_map.h',
228 'policy/core/common/policy_namespace.cc',
229 'policy/core/common/policy_namespace.h',
230 'policy/core/common/policy_service.cc',
231 'policy/core/common/policy_service.h',
232 'policy/core/common/policy_service_stub.cc',
233 'policy/core/common/policy_service_stub.h',
234 'policy/core/common/url_blacklist_manager.cc',
235 'policy/core/common/url_blacklist_manager.h',
242 ['configuration_policy==1', {
245 'target_name': 'cloud_policy_code_generate',
250 'policy/resources/policy_templates.json',
251 '<(generate_policy_source_script_path)',
254 '<(policy_constant_header_path)',
255 '<(policy_constant_source_path)',
256 '<(protobuf_decoder_path)',
257 '<(chrome_settings_proto_path)',
258 '<(cloud_policy_proto_path)',
260 'action_name': 'generate_policy_source',
263 '<@(generate_policy_source_script_path)',
264 '--policy-constants-header=<(policy_constant_header_path)',
265 '--policy-constants-source=<(policy_constant_source_path)',
266 '--chrome-settings-protobuf=<(chrome_settings_proto_path)',
267 '--cloud-policy-protobuf=<(cloud_policy_proto_path)',
268 '--cloud-policy-decoder=<(protobuf_decoder_path)',
271 'policy/resources/policy_templates.json',
273 'message': 'Generating policy source',
276 'direct_dependent_settings': {
284 'target_name': 'cloud_policy_proto_generated_compile',
285 'type': 'static_library',
287 '<(cloud_policy_proto_path)',
290 'proto_in_dir': '<(policy_out_dir)/policy',
291 'proto_out_dir': 'policy/proto',
294 'cloud_policy_code_generate',
297 '../build/protoc.gypi',
299 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
300 'msvs_disabled_warnings': [4267, ],
303 # This target builds the "full" protobuf, used for tests only.
304 'target_name': 'chrome_settings_proto_generated_compile',
305 'type': 'static_library',
307 '<(chrome_settings_proto_path)',
310 'proto_in_dir': '<(policy_out_dir)/policy',
311 'proto_out_dir': 'policy/proto',
314 'cloud_policy_code_generate',
315 'cloud_policy_proto_generated_compile',
318 '../build/protoc.gypi',
322 'target_name': 'policy',
323 'type': 'static_library',
324 'hard_dependency': 1,
325 'direct_dependent_settings': {
332 '<(policy_constant_header_path)',
333 '<(policy_constant_source_path)',
334 '<(protobuf_decoder_path)',
340 'cloud_policy_code_generate',
341 'cloud_policy_proto_generated_compile',
342 '<(DEPTH)/base/base.gyp:base',
343 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
346 'POLICY_COMPONENT_IMPLEMENTATION',
350 'target_name': 'cloud_policy_proto',
351 'type': 'static_library',
353 'policy/proto/chrome_extension_policy.proto',
354 'policy/proto/device_management_backend.proto',
355 'policy/proto/device_management_local.proto',
358 'proto_in_dir': 'policy/proto',
359 'proto_out_dir': 'policy/proto',
362 '../build/protoc.gypi',
367 'policy/proto/chrome_extension_policy.proto',
372 'policy/proto/device_management_local.proto',
378 'target_name': 'policy_test_support',
380 'hard_dependency': 1,
381 'direct_dependent_settings': {
388 'chrome_settings_proto_generated_compile',
393 'target_name': 'policy_component_test_support',
394 'type': 'static_library',
395 # This must be undefined so that POLICY_EXPORT works correctly in
396 # the static_library build.
398 'POLICY_COMPONENT_IMPLEMENTATION',
401 'cloud_policy_proto',
403 'policy_test_support',
404 '../testing/gmock.gyp:gmock',
405 '../testing/gtest.gyp:gtest',
411 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
412 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
413 'policy/core/common/cloud/mock_cloud_policy_client.cc',
414 'policy/core/common/cloud/mock_cloud_policy_client.h',
415 'policy/core/common/cloud/mock_cloud_policy_store.cc',
416 'policy/core/common/cloud/mock_cloud_policy_store.h',
417 'policy/core/common/cloud/mock_device_management_service.cc',
418 'policy/core/common/cloud/mock_device_management_service.h',
419 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
420 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
421 'policy/core/common/cloud/policy_builder.cc',
422 'policy/core/common/cloud/policy_builder.h',
423 'policy/core/common/configuration_policy_provider_test.cc',
424 'policy/core/common/configuration_policy_provider_test.h',
425 'policy/core/common/mock_configuration_policy_provider.cc',
426 'policy/core/common/mock_configuration_policy_provider.h',
427 'policy/core/common/mock_policy_service.cc',
428 'policy/core/common/mock_policy_service.h',
429 'policy/core/common/policy_test_utils.cc',
430 'policy/core/common/policy_test_utils.h',
431 'policy/core/common/preferences_mock_mac.cc',
432 'policy/core/common/preferences_mock_mac.h',
437 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
438 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
445 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
448 'target_name': 'policy_win64',
449 'type': 'static_library',
450 'hard_dependency': 1,
452 '<(policy_constant_header_path)',
453 '<(policy_constant_source_path)',
458 'direct_dependent_settings': {
464 'cloud_policy_code_generate',
468 'msvs_target_platform': 'x64',
474 ['OS=="win" or OS=="mac" or OS=="linux"', {
477 # policy_templates has different inputs and outputs, so it can't use
478 # the rules of chrome_strings
479 'target_name': 'policy_templates',
482 'grit_grd_file': 'policy/resources/policy_templates.grd',
485 '<(DEPTH)/tools/grit/grit_info.py',
490 '../build/grit_target.gypi',
494 'action_name': 'policy_templates',
496 '../build/grit_action.gypi',
506 # This is the bundle of the manifest file of Chrome.
507 # It contains the manifest file and its string tables.
508 'target_name': 'chrome_manifest_bundle',
509 'type': 'loadable_module',
511 'product_extension': 'manifest',
512 'product_name': '<(mac_bundle_id)',
514 # This avoids stripping debugging symbols from the target, which
515 # would fail because there is no binary code here.
519 # Provides app-Manifest.plist and its string tables:
524 'action_name': 'Copy MCX manifest file to manifest bundle',
526 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
529 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
532 # Use plutil -convert xml1 to put the plist into Apple's
533 # canonical format. As a side effect, this ensures that the
534 # plist is well-formed.
543 'Copying the MCX policy manifest file to the manifest bundle',
544 'process_outputs_as_mac_bundle_resources': 1,
548 'Copy Localizable.strings files to manifest bundle',
550 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
551 # Directory to collect the Localizable.strings files before
552 # they are copied to the bundle.
553 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
554 # The reason we are not enumerating all the locales is that
555 # the translations would eat up 3.5MB disk space in the
556 # application bundle:
557 'available_locales': 'en',
560 # TODO: remove this helper when we have loops in GYP
561 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
564 # TODO: remove this helper when we have loops in GYP
565 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
573 'Copy the Localizable.strings files to the manifest bundle',
574 'process_outputs_as_mac_bundle_resources': 1,
575 'msvs_cygwin_shell': 1,