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 'app_restrictions_path':
24 '<(policy_out_dir)/app_restrictions.xml',
25 # This is the "full" protobuf, which defines one protobuf message per
26 # policy. It is also the format currently used by the server.
27 'chrome_settings_proto_path':
28 '<(policy_out_dir)/policy/chrome_settings.proto',
29 # This protobuf is equivalent to chrome_settings.proto but shares messages
30 # for policies of the same type, so that less classes have to be generated
32 'cloud_policy_proto_path':
33 '<(policy_out_dir)/policy/cloud_policy.proto',
36 ['component=="static_library"', {
39 # GN version: //components/policy:policy_component
40 'target_name': 'policy_component',
43 'policy_component_common',
44 'policy_component_browser',
48 # GN version: //components/policy:policy_component_common
49 'target_name': 'policy_component_common',
50 'type': 'static_library',
52 'policy/policy_common.gypi',
56 # GN version: //components/policy:policy_component_browser
57 'target_name': 'policy_component_browser',
58 'type': 'static_library',
60 'policy_component_common',
63 'policy/policy_browser.gypi',
67 }, { # component=="shared_library"
70 # GN version: //components/policy:policy_component
71 'target_name': 'policy_component',
72 'type': 'shared_library',
74 'policy/policy_common.gypi',
75 'policy/policy_browser.gypi',
79 # GN version: //components/policy:policy_component_common
80 'target_name': 'policy_component_common',
87 # GN version: //components/policy:policy_component_browser
88 'target_name': 'policy_component_browser',
96 ['configuration_policy==1', {
99 # GN version: //components/policy:cloud_policy_code_generate
100 'target_name': 'cloud_policy_code_generate',
105 'policy/resources/policy_templates.json',
106 '<(generate_policy_source_script_path)',
109 '<(policy_constant_header_path)',
110 '<(policy_constant_source_path)',
111 '<(protobuf_decoder_path)',
112 '<(chrome_settings_proto_path)',
113 '<(cloud_policy_proto_path)',
114 '<(app_restrictions_path)',
116 'action_name': 'generate_policy_source',
119 '<@(generate_policy_source_script_path)',
120 '--policy-constants-header=<(policy_constant_header_path)',
121 '--policy-constants-source=<(policy_constant_source_path)',
122 '--chrome-settings-protobuf=<(chrome_settings_proto_path)',
123 '--cloud-policy-protobuf=<(cloud_policy_proto_path)',
124 '--cloud-policy-decoder=<(protobuf_decoder_path)',
125 '--app-restrictions-definition=<(app_restrictions_path)',
128 'policy/resources/policy_templates.json',
130 'message': 'Generating policy source',
134 '<(app_restrictions_path)',
140 'direct_dependent_settings': {
148 # GN version: //components/policy:cloud_policy_proto_generated_compile
149 'target_name': 'cloud_policy_proto_generated_compile',
150 'type': '<(component)',
152 '<(cloud_policy_proto_path)',
155 'proto_in_dir': '<(policy_out_dir)/policy',
156 'proto_out_dir': 'policy/proto',
157 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
158 'cc_include': 'components/policy/policy_proto_export.h',
161 'cloud_policy_code_generate',
164 '../build/protoc.gypi',
167 'POLICY_PROTO_COMPILATION',
169 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
170 'msvs_disabled_warnings': [4267, ],
173 # This target builds the "full" protobuf, used for tests only.
174 # GN version: //components/policy:chrome_settings_proto_generated_compile
175 'target_name': 'chrome_settings_proto_generated_compile',
176 'type': 'static_library',
178 '<(chrome_settings_proto_path)',
181 'proto_in_dir': '<(policy_out_dir)/policy',
182 'proto_out_dir': 'policy/proto',
185 'cloud_policy_code_generate',
186 'cloud_policy_proto_generated_compile',
189 '../build/protoc.gypi',
193 # GN version: //components/policy
194 'target_name': 'policy',
195 'type': 'static_library',
196 'hard_dependency': 1,
197 'direct_dependent_settings': {
204 '<(policy_constant_header_path)',
205 '<(policy_constant_source_path)',
206 '<(protobuf_decoder_path)',
212 'cloud_policy_code_generate',
213 'cloud_policy_proto_generated_compile',
214 '<(DEPTH)/base/base.gyp:base',
215 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
218 'POLICY_COMPONENT_IMPLEMENTATION',
222 # GN version: //components/policy/proto
223 'target_name': 'cloud_policy_proto',
224 'type': '<(component)',
226 'policy/proto/chrome_extension_policy.proto',
227 'policy/proto/device_management_backend.proto',
228 'policy/proto/device_management_local.proto',
229 'policy/proto/policy_signing_key.proto',
232 'proto_in_dir': 'policy/proto',
233 'proto_out_dir': 'policy/proto',
234 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
235 'cc_include': 'components/policy/policy_proto_export.h',
238 '../build/protoc.gypi',
241 ['OS=="android" or OS=="ios"', {
243 'policy/proto/chrome_extension_policy.proto',
248 'policy/proto/device_management_local.proto',
253 'POLICY_PROTO_COMPILATION',
257 # GN version: //components/policy:test_support
258 'target_name': 'policy_test_support',
260 'hard_dependency': 1,
261 'direct_dependent_settings': {
268 'chrome_settings_proto_generated_compile',
273 # GN version: //components/policy:policy_component_test_support
274 'target_name': 'policy_component_test_support',
275 'type': 'static_library',
276 # This must be undefined so that POLICY_EXPORT works correctly in
277 # the static_library build.
279 'POLICY_COMPONENT_IMPLEMENTATION',
282 'cloud_policy_proto',
284 'policy_test_support',
285 '../testing/gmock.gyp:gmock',
286 '../testing/gtest.gyp:gtest',
292 'policy/core/browser/configuration_policy_pref_store_test.cc',
293 'policy/core/browser/configuration_policy_pref_store_test.h',
294 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
295 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
296 'policy/core/common/cloud/mock_cloud_policy_client.cc',
297 'policy/core/common/cloud/mock_cloud_policy_client.h',
298 'policy/core/common/cloud/mock_cloud_policy_store.cc',
299 'policy/core/common/cloud/mock_cloud_policy_store.h',
300 'policy/core/common/cloud/mock_device_management_service.cc',
301 'policy/core/common/cloud/mock_device_management_service.h',
302 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
303 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
304 'policy/core/common/cloud/policy_builder.cc',
305 'policy/core/common/cloud/policy_builder.h',
306 'policy/core/common/configuration_policy_provider_test.cc',
307 'policy/core/common/configuration_policy_provider_test.h',
308 'policy/core/common/fake_async_policy_loader.cc',
309 'policy/core/common/fake_async_policy_loader.h',
310 'policy/core/common/mock_configuration_policy_provider.cc',
311 'policy/core/common/mock_configuration_policy_provider.h',
312 'policy/core/common/mock_policy_service.cc',
313 'policy/core/common/mock_policy_service.h',
314 'policy/core/common/policy_test_utils.cc',
315 'policy/core/common/policy_test_utils.h',
316 'policy/core/common/preferences_mock_mac.cc',
317 'policy/core/common/preferences_mock_mac.h',
318 'policy/core/common/remote_commands/test_remote_command_job.cc',
319 'policy/core/common/remote_commands/test_remote_command_job.h',
320 'policy/core/common/remote_commands/testing_remote_commands_server.cc',
321 'policy/core/common/remote_commands/testing_remote_commands_server.h',
326 'policy/core/common/fake_async_policy_loader.cc',
327 'policy/core/common/fake_async_policy_loader.h',
332 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
333 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
340 ['OS=="android" and configuration_policy==1', {
343 'target_name': 'app_restrictions_resources',
346 'resources_zip': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
347 'input_resources_dir':
348 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/policy/android',
349 'create_zip_script': '../build/android/gyp/zip.py',
353 'destination': '<(input_resources_dir)/xml-v21/',
355 '<(SHARED_INTERMEDIATE_DIR)/policy/app_restrictions.xml'
361 'action_name': 'remove_localized_resources',
363 '<(input_resources_dir)/remove_localized_resources.d.stamp'
366 'policy/tools/remove_localized_app_restrictions.py',
370 'policy/tools/remove_localized_app_restrictions.py',
371 '<(input_resources_dir)',
375 'action_name': 'create_resources_zip',
377 '<(create_zip_script)',
378 '<(input_resources_dir)/xml-v21/app_restrictions.xml',
379 '<(input_resources_dir)/values-v21/restriction_values.xml',
380 # A dummy stamp file to remove localized resources without
381 # clobbering the build.
382 # TODO(475515): Remove after all build bots have run
383 # 'remove_localized_resources' target.
384 '<(input_resources_dir)/remove_localized_resources.d.stamp',
390 'python', '<(create_zip_script)',
391 '--input-dir', '<(input_resources_dir)',
392 '--output', '<(resources_zip)',
396 'all_dependent_settings': {
398 'additional_input_paths': ['<(resources_zip)'],
399 'dependencies_res_zip_paths': ['<(resources_zip)'],
405 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
408 'target_name': 'policy_win64',
409 'type': 'static_library',
410 'hard_dependency': 1,
412 '<(policy_constant_header_path)',
413 '<(policy_constant_source_path)',
418 'direct_dependent_settings': {
424 'cloud_policy_code_generate',
428 'msvs_target_platform': 'x64',
437 # policy_templates has different inputs and outputs, so it can't use
438 # the rules of chrome_strings
439 'target_name': 'policy_templates',
442 'grit_grd_file': 'policy/resources/policy_templates.grd',
445 '<(DEPTH)/tools/grit/grit_info.py',
450 '../build/grit_target.gypi',
454 'action_name': 'policy_templates',
456 '../build/grit_action.gypi',
466 # This is the bundle of the manifest file of Chrome.
467 # It contains the manifest file and its string tables.
468 'target_name': 'chrome_manifest_bundle',
469 'type': 'loadable_module',
471 'product_extension': 'manifest',
472 'product_name': '<(mac_bundle_id)',
474 # This avoids stripping debugging symbols from the target, which
475 # would fail because there is no binary code here.
479 # Provides app-Manifest.plist and its string tables:
484 'action_name': 'Copy MCX manifest file to manifest bundle',
486 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
489 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
492 # Use plutil -convert xml1 to put the plist into Apple's
493 # canonical format. As a side effect, this ensures that the
494 # plist is well-formed.
503 'Copying the MCX policy manifest file to the manifest bundle',
504 'process_outputs_as_mac_bundle_resources': 1,
508 'Copy Localizable.strings files to manifest bundle',
510 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
511 # Directory to collect the Localizable.strings files before
512 # they are copied to the bundle.
513 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
514 # The reason we are not enumerating all the locales is that
515 # the translations would eat up 3.5MB disk space in the
516 # application bundle:
517 'available_locales': 'en',
520 # TODO: remove this helper when we have loops in GYP
521 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
524 # TODO: remove this helper when we have loops in GYP
525 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
533 'Copy the Localizable.strings files to the manifest bundle',
534 'process_outputs_as_mac_bundle_resources': 1,