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 'dependencies': ['policy_jni_headers']},
72 }, { # component=="shared_library"
75 # GN version: //components/policy:policy_component
76 'target_name': 'policy_component',
77 'type': 'shared_library',
79 'policy/policy_common.gypi',
80 'policy/policy_browser.gypi',
84 # GN version: //components/policy:policy_component_common
85 'target_name': 'policy_component_common',
92 'dependencies': ['policy_jni_headers']},
97 # GN version: //components/policy:policy_component_browser
98 'target_name': 'policy_component_browser',
106 ['configuration_policy==1', {
109 # GN version: //components/policy:cloud_policy_code_generate
110 'target_name': 'cloud_policy_code_generate',
115 'policy/resources/policy_templates.json',
116 '<(DEPTH)/chrome/VERSION',
117 '<(generate_policy_source_script_path)',
120 '<(policy_constant_header_path)',
121 '<(policy_constant_source_path)',
122 '<(protobuf_decoder_path)',
123 '<(chrome_settings_proto_path)',
124 '<(cloud_policy_proto_path)',
125 '<(app_restrictions_path)',
127 'action_name': 'generate_policy_source',
130 '<@(generate_policy_source_script_path)',
131 '--policy-constants-header=<(policy_constant_header_path)',
132 '--policy-constants-source=<(policy_constant_source_path)',
133 '--chrome-settings-protobuf=<(chrome_settings_proto_path)',
134 '--cloud-policy-protobuf=<(cloud_policy_proto_path)',
135 '--cloud-policy-decoder=<(protobuf_decoder_path)',
136 '--app-restrictions-definition=<(app_restrictions_path)',
137 '<(DEPTH)/chrome/VERSION',
140 'policy/resources/policy_templates.json',
142 'message': 'Generating policy source',
146 '<(app_restrictions_path)',
152 'direct_dependent_settings': {
160 # GN version: //components/policy:cloud_policy_proto_generated_compile
161 'target_name': 'cloud_policy_proto_generated_compile',
162 'type': '<(component)',
164 '<(cloud_policy_proto_path)',
167 'proto_in_dir': '<(policy_out_dir)/policy',
168 'proto_out_dir': 'policy/proto',
169 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
170 'cc_include': 'components/policy/policy_proto_export.h',
173 'cloud_policy_code_generate',
176 '../build/protoc.gypi',
179 'POLICY_PROTO_COMPILATION',
181 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
182 'msvs_disabled_warnings': [4267, ],
185 # This target builds the "full" protobuf, used for tests only.
186 # GN version: //components/policy:chrome_settings_proto_generated_compile
187 'target_name': 'chrome_settings_proto_generated_compile',
188 'type': 'static_library',
190 '<(chrome_settings_proto_path)',
193 'proto_in_dir': '<(policy_out_dir)/policy',
194 'proto_out_dir': 'policy/proto',
197 'cloud_policy_code_generate',
198 'cloud_policy_proto_generated_compile',
201 '../build/protoc.gypi',
205 # GN version: //components/policy
206 'target_name': 'policy',
207 'type': 'static_library',
208 'hard_dependency': 1,
209 'direct_dependent_settings': {
216 '<(policy_constant_header_path)',
217 '<(policy_constant_source_path)',
218 '<(protobuf_decoder_path)',
224 'cloud_policy_code_generate',
225 'cloud_policy_proto_generated_compile',
226 '<(DEPTH)/base/base.gyp:base',
227 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
230 'POLICY_COMPONENT_IMPLEMENTATION',
234 # GN version: //components/policy/proto
235 'target_name': 'cloud_policy_proto',
236 'type': '<(component)',
238 'policy/proto/chrome_extension_policy.proto',
239 'policy/proto/device_management_backend.proto',
240 'policy/proto/device_management_local.proto',
241 'policy/proto/policy_signing_key.proto',
244 'proto_in_dir': 'policy/proto',
245 'proto_out_dir': 'policy/proto',
246 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
247 'cc_include': 'components/policy/policy_proto_export.h',
250 '../build/protoc.gypi',
253 ['OS=="android" or OS=="ios"', {
255 'policy/proto/chrome_extension_policy.proto',
260 'policy/proto/device_management_local.proto',
265 'POLICY_PROTO_COMPILATION',
269 # GN version: //components/policy:test_support
270 'target_name': 'policy_test_support',
272 'hard_dependency': 1,
273 'direct_dependent_settings': {
280 'chrome_settings_proto_generated_compile',
285 # GN version: //components/policy:policy_component_test_support
286 'target_name': 'policy_component_test_support',
287 'type': 'static_library',
288 # This must be undefined so that POLICY_EXPORT works correctly in
289 # the static_library build.
291 'POLICY_COMPONENT_IMPLEMENTATION',
294 'cloud_policy_proto',
296 'policy_test_support',
297 '../testing/gmock.gyp:gmock',
298 '../testing/gtest.gyp:gtest',
304 'policy/core/browser/configuration_policy_pref_store_test.cc',
305 'policy/core/browser/configuration_policy_pref_store_test.h',
306 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
307 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
308 'policy/core/common/cloud/mock_cloud_policy_client.cc',
309 'policy/core/common/cloud/mock_cloud_policy_client.h',
310 'policy/core/common/cloud/mock_cloud_policy_store.cc',
311 'policy/core/common/cloud/mock_cloud_policy_store.h',
312 'policy/core/common/cloud/mock_device_management_service.cc',
313 'policy/core/common/cloud/mock_device_management_service.h',
314 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
315 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
316 'policy/core/common/cloud/policy_builder.cc',
317 'policy/core/common/cloud/policy_builder.h',
318 'policy/core/common/configuration_policy_provider_test.cc',
319 'policy/core/common/configuration_policy_provider_test.h',
320 'policy/core/common/fake_async_policy_loader.cc',
321 'policy/core/common/fake_async_policy_loader.h',
322 'policy/core/common/mock_configuration_policy_provider.cc',
323 'policy/core/common/mock_configuration_policy_provider.h',
324 'policy/core/common/mock_policy_service.cc',
325 'policy/core/common/mock_policy_service.h',
326 'policy/core/common/policy_test_utils.cc',
327 'policy/core/common/policy_test_utils.h',
328 'policy/core/common/preferences_mock_mac.cc',
329 'policy/core/common/preferences_mock_mac.h',
330 'policy/core/common/remote_commands/test_remote_command_job.cc',
331 'policy/core/common/remote_commands/test_remote_command_job.h',
332 'policy/core/common/remote_commands/testing_remote_commands_server.cc',
333 'policy/core/common/remote_commands/testing_remote_commands_server.h',
338 'policy/core/common/fake_async_policy_loader.cc',
339 'policy/core/common/fake_async_policy_loader.h',
344 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
345 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
356 'target_name' : 'policy_jni_headers',
359 'policy/android/java/src/org/chromium/policy/CombinedPolicyProvider.java',
360 'policy/android/java/src/org/chromium/policy/PolicyConverter.java',
363 'jni_gen_package': 'policy',
365 'includes': [ '../build/jni_generator.gypi' ],
369 ['OS=="android" and configuration_policy==1', {
372 'target_name': 'app_restrictions_resources',
375 'resources_zip': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
376 'input_resources_dir':
377 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/policy/android',
378 'create_zip_script': '../build/android/gyp/zip.py',
382 'destination': '<(input_resources_dir)/xml-v21/',
384 '<(SHARED_INTERMEDIATE_DIR)/policy/app_restrictions.xml'
390 'action_name': 'create_resources_zip',
392 '<(create_zip_script)',
393 '<(input_resources_dir)/xml-v21/app_restrictions.xml',
394 '<(input_resources_dir)/values-v21/restriction_values.xml',
400 'python', '<(create_zip_script)',
401 '--input-dir', '<(input_resources_dir)',
402 '--output', '<(resources_zip)',
406 'all_dependent_settings': {
408 'additional_input_paths': ['<(resources_zip)'],
409 'dependencies_res_zip_paths': ['<(resources_zip)'],
414 # GN: //components/policy/android:policy_java
415 'target_name': 'policy_java',
418 '../base/base.gyp:base_java',
421 'java_in_dir': 'policy/android/java',
423 'includes': [ '../build/java.gypi' ],
427 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
430 'target_name': 'policy_win64',
431 'type': 'static_library',
432 'hard_dependency': 1,
434 '<(policy_constant_header_path)',
435 '<(policy_constant_source_path)',
440 'direct_dependent_settings': {
446 'cloud_policy_code_generate',
450 'msvs_target_platform': 'x64',
459 # policy_templates has different inputs and outputs, so it can't use
460 # the rules of chrome_strings
461 'target_name': 'policy_templates',
464 'grit_grd_file': 'policy/resources/policy_templates.grd',
467 '<(DEPTH)/tools/grit/grit_info.py',
472 '../build/grit_target.gypi',
476 'action_name': 'policy_templates',
478 '../build/grit_action.gypi',
488 # This is the bundle of the manifest file of Chrome.
489 # It contains the manifest file and its string tables.
490 'target_name': 'chrome_manifest_bundle',
491 'type': 'loadable_module',
493 'product_extension': 'manifest',
494 'product_name': '<(mac_bundle_id)',
496 # This avoids stripping debugging symbols from the target, which
497 # would fail because there is no binary code here.
501 # Provides app-Manifest.plist and its string tables:
506 'action_name': 'Copy MCX manifest file to manifest bundle',
508 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
511 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
514 # Use plutil -convert xml1 to put the plist into Apple's
515 # canonical format. As a side effect, this ensures that the
516 # plist is well-formed.
525 'Copying the MCX policy manifest file to the manifest bundle',
526 'process_outputs_as_mac_bundle_resources': 1,
530 'Copy Localizable.strings files to manifest bundle',
532 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
533 # Directory to collect the Localizable.strings files before
534 # they are copied to the bundle.
535 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
536 # The reason we are not enumerating all the locales is that
537 # the translations would eat up 3.5MB disk space in the
538 # application bundle:
539 'available_locales': 'en',
542 # TODO: remove this helper when we have loops in GYP
543 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
546 # TODO: remove this helper when we have loops in GYP
547 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
555 'Copy the Localizable.strings files to the manifest bundle',
556 'process_outputs_as_mac_bundle_resources': 1,