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 'android_resources_out_dir': '<(policy_out_dir)/android_resources',
16 'generate_policy_source_script_path':
17 'policy/tools/generate_policy_source.py',
18 'policy_constant_header_path':
19 '<(policy_out_dir)/policy/policy_constants.h',
20 'policy_constant_source_path':
21 '<(policy_out_dir)/policy/policy_constants.cc',
22 'protobuf_decoder_path':
23 '<(policy_out_dir)/policy/cloud_policy_generated.cc',
24 'app_restrictions_path':
25 '<(android_resources_out_dir)/xml-v21/app_restrictions.xml',
27 '<(android_resources_out_dir)/values-v21/restriction_values.xml',
28 # This is the "full" protobuf, which defines one protobuf message per
29 # policy. It is also the format currently used by the server.
30 'chrome_settings_proto_path':
31 '<(policy_out_dir)/policy/chrome_settings.proto',
32 # This protobuf is equivalent to chrome_settings.proto but shares messages
33 # for policies of the same type, so that less classes have to be generated
35 'cloud_policy_proto_path':
36 '<(policy_out_dir)/policy/cloud_policy.proto',
39 ['component=="static_library"', {
42 # GN version: //components/policy:policy_component
43 'target_name': 'policy_component',
46 'policy_component_common',
47 'policy_component_browser',
51 # GN version: //components/policy:policy_component_common
52 'target_name': 'policy_component_common',
53 'type': 'static_library',
55 'policy/policy_common.gypi',
59 # GN version: //components/policy:policy_component_browser
60 'target_name': 'policy_component_browser',
61 'type': 'static_library',
63 'policy_component_common',
66 'policy/policy_browser.gypi',
70 }, { # component=="shared_library"
73 # GN version: //components/policy:policy_component
74 'target_name': 'policy_component',
75 'type': 'shared_library',
77 'policy/policy_common.gypi',
78 'policy/policy_browser.gypi',
82 # GN version: //components/policy:policy_component_common
83 'target_name': 'policy_component_common',
90 # GN version: //components/policy:policy_component_browser
91 'target_name': 'policy_component_browser',
99 ['configuration_policy==1', {
102 # GN version: //components/policy:cloud_policy_code_generate
103 'target_name': 'cloud_policy_code_generate',
108 'policy/resources/policy_templates.json',
109 '<(generate_policy_source_script_path)',
112 '<(policy_constant_header_path)',
113 '<(policy_constant_source_path)',
114 '<(protobuf_decoder_path)',
115 '<(chrome_settings_proto_path)',
116 '<(cloud_policy_proto_path)',
117 '<(app_restrictions_path)',
118 '<(app_resources_path)',
120 'action_name': 'generate_policy_source',
123 '<@(generate_policy_source_script_path)',
124 '--policy-constants-header=<(policy_constant_header_path)',
125 '--policy-constants-source=<(policy_constant_source_path)',
126 '--chrome-settings-protobuf=<(chrome_settings_proto_path)',
127 '--cloud-policy-protobuf=<(cloud_policy_proto_path)',
128 '--cloud-policy-decoder=<(protobuf_decoder_path)',
129 '--app-restrictions-definition=<(app_restrictions_path)',
130 '--app-restrictions-resources=<(app_resources_path)',
133 'policy/resources/policy_templates.json',
135 'message': 'Generating policy source',
139 '<(app_restrictions_path)',
140 '<(app_resources_path)',
146 'direct_dependent_settings': {
154 # GN version: //components/policy:cloud_policy_proto_generated_compile
155 'target_name': 'cloud_policy_proto_generated_compile',
156 'type': '<(component)',
158 '<(cloud_policy_proto_path)',
161 'proto_in_dir': '<(policy_out_dir)/policy',
162 'proto_out_dir': 'policy/proto',
163 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
164 'cc_include': 'components/policy/policy_proto_export.h',
167 'cloud_policy_code_generate',
170 '../build/protoc.gypi',
173 'POLICY_PROTO_COMPILATION',
175 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
176 'msvs_disabled_warnings': [4267, ],
179 # This target builds the "full" protobuf, used for tests only.
180 # GN version: //components/policy:chrome_settings_proto_generated_compile
181 'target_name': 'chrome_settings_proto_generated_compile',
182 'type': 'static_library',
184 '<(chrome_settings_proto_path)',
187 'proto_in_dir': '<(policy_out_dir)/policy',
188 'proto_out_dir': 'policy/proto',
191 'cloud_policy_code_generate',
192 'cloud_policy_proto_generated_compile',
195 '../build/protoc.gypi',
199 # GN version: //components/policy
200 'target_name': 'policy',
201 'type': 'static_library',
202 'hard_dependency': 1,
203 'direct_dependent_settings': {
210 '<(policy_constant_header_path)',
211 '<(policy_constant_source_path)',
212 '<(protobuf_decoder_path)',
218 'cloud_policy_code_generate',
219 'cloud_policy_proto_generated_compile',
220 '<(DEPTH)/base/base.gyp:base',
221 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
224 'POLICY_COMPONENT_IMPLEMENTATION',
228 # GN version: //components/policy/proto
229 'target_name': 'cloud_policy_proto',
230 'type': '<(component)',
232 'policy/proto/chrome_extension_policy.proto',
233 'policy/proto/device_management_backend.proto',
234 'policy/proto/device_management_local.proto',
235 'policy/proto/policy_signing_key.proto',
238 'proto_in_dir': 'policy/proto',
239 'proto_out_dir': 'policy/proto',
240 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
241 'cc_include': 'components/policy/policy_proto_export.h',
244 '../build/protoc.gypi',
247 ['OS=="android" or OS=="ios"', {
249 'policy/proto/chrome_extension_policy.proto',
254 'policy/proto/device_management_local.proto',
259 'POLICY_PROTO_COMPILATION',
263 # GN version: //components/policy:test_support
264 'target_name': 'policy_test_support',
266 'hard_dependency': 1,
267 'direct_dependent_settings': {
274 'chrome_settings_proto_generated_compile',
279 # GN version: //components/policy:policy_component_test_support
280 'target_name': 'policy_component_test_support',
281 'type': 'static_library',
282 # This must be undefined so that POLICY_EXPORT works correctly in
283 # the static_library build.
285 'POLICY_COMPONENT_IMPLEMENTATION',
288 'cloud_policy_proto',
290 'policy_test_support',
291 '../testing/gmock.gyp:gmock',
292 '../testing/gtest.gyp:gtest',
298 'policy/core/browser/configuration_policy_pref_store_test.cc',
299 'policy/core/browser/configuration_policy_pref_store_test.h',
300 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
301 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
302 'policy/core/common/cloud/mock_cloud_policy_client.cc',
303 'policy/core/common/cloud/mock_cloud_policy_client.h',
304 'policy/core/common/cloud/mock_cloud_policy_store.cc',
305 'policy/core/common/cloud/mock_cloud_policy_store.h',
306 'policy/core/common/cloud/mock_device_management_service.cc',
307 'policy/core/common/cloud/mock_device_management_service.h',
308 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
309 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
310 'policy/core/common/cloud/policy_builder.cc',
311 'policy/core/common/cloud/policy_builder.h',
312 'policy/core/common/configuration_policy_provider_test.cc',
313 'policy/core/common/configuration_policy_provider_test.h',
314 'policy/core/common/fake_async_policy_loader.cc',
315 'policy/core/common/fake_async_policy_loader.h',
316 'policy/core/common/mock_configuration_policy_provider.cc',
317 'policy/core/common/mock_configuration_policy_provider.h',
318 'policy/core/common/mock_policy_service.cc',
319 'policy/core/common/mock_policy_service.h',
320 'policy/core/common/policy_test_utils.cc',
321 'policy/core/common/policy_test_utils.h',
322 'policy/core/common/preferences_mock_mac.cc',
323 'policy/core/common/preferences_mock_mac.h',
324 'policy/core/common/remote_commands/test_remote_command_job.cc',
325 'policy/core/common/remote_commands/test_remote_command_job.h',
326 'policy/core/common/remote_commands/testing_remote_commands_server.cc',
327 'policy/core/common/remote_commands/testing_remote_commands_server.h',
332 'policy/core/common/fake_async_policy_loader.cc',
333 'policy/core/common/fake_async_policy_loader.h',
338 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
339 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
346 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
349 'target_name': 'policy_win64',
350 'type': 'static_library',
351 'hard_dependency': 1,
353 '<(policy_constant_header_path)',
354 '<(policy_constant_source_path)',
359 'direct_dependent_settings': {
365 'cloud_policy_code_generate',
369 'msvs_target_platform': 'x64',
375 ['OS=="win" or OS=="mac" or OS=="linux"', {
378 # policy_templates has different inputs and outputs, so it can't use
379 # the rules of chrome_strings
380 'target_name': 'policy_templates',
383 'grit_grd_file': 'policy/resources/policy_templates.grd',
386 '<(DEPTH)/tools/grit/grit_info.py',
391 '../build/grit_target.gypi',
395 'action_name': 'policy_templates',
397 '../build/grit_action.gypi',
407 # This is the bundle of the manifest file of Chrome.
408 # It contains the manifest file and its string tables.
409 'target_name': 'chrome_manifest_bundle',
410 'type': 'loadable_module',
412 'product_extension': 'manifest',
413 'product_name': '<(mac_bundle_id)',
415 # This avoids stripping debugging symbols from the target, which
416 # would fail because there is no binary code here.
420 # Provides app-Manifest.plist and its string tables:
425 'action_name': 'Copy MCX manifest file to manifest bundle',
427 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
430 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
433 # Use plutil -convert xml1 to put the plist into Apple's
434 # canonical format. As a side effect, this ensures that the
435 # plist is well-formed.
444 'Copying the MCX policy manifest file to the manifest bundle',
445 'process_outputs_as_mac_bundle_resources': 1,
449 'Copy Localizable.strings files to manifest bundle',
451 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
452 # Directory to collect the Localizable.strings files before
453 # they are copied to the bundle.
454 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
455 # The reason we are not enumerating all the locales is that
456 # the translations would eat up 3.5MB disk space in the
457 # application bundle:
458 'available_locales': 'en',
461 # TODO: remove this helper when we have loops in GYP
462 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
465 # TODO: remove this helper when we have loops in GYP
466 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
474 'Copy the Localizable.strings files to the manifest bundle',
475 'process_outputs_as_mac_bundle_resources': 1,