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',
324 'policy/core/common/fake_async_policy_loader.cc',
325 'policy/core/common/fake_async_policy_loader.h',
330 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
331 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
338 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
341 'target_name': 'policy_win64',
342 'type': 'static_library',
343 'hard_dependency': 1,
345 '<(policy_constant_header_path)',
346 '<(policy_constant_source_path)',
351 'direct_dependent_settings': {
357 'cloud_policy_code_generate',
361 'msvs_target_platform': 'x64',
370 # policy_templates has different inputs and outputs, so it can't use
371 # the rules of chrome_strings
372 'target_name': 'policy_templates',
375 'grit_grd_file': 'policy/resources/policy_templates.grd',
378 '<(DEPTH)/tools/grit/grit_info.py',
383 '../build/grit_target.gypi',
387 'action_name': 'policy_templates',
389 '../build/grit_action.gypi',
399 # This is the bundle of the manifest file of Chrome.
400 # It contains the manifest file and its string tables.
401 'target_name': 'chrome_manifest_bundle',
402 'type': 'loadable_module',
404 'product_extension': 'manifest',
405 'product_name': '<(mac_bundle_id)',
407 # This avoids stripping debugging symbols from the target, which
408 # would fail because there is no binary code here.
412 # Provides app-Manifest.plist and its string tables:
417 'action_name': 'Copy MCX manifest file to manifest bundle',
419 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
422 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
425 # Use plutil -convert xml1 to put the plist into Apple's
426 # canonical format. As a side effect, this ensures that the
427 # plist is well-formed.
436 'Copying the MCX policy manifest file to the manifest bundle',
437 'process_outputs_as_mac_bundle_resources': 1,
441 'Copy Localizable.strings files to manifest bundle',
443 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
444 # Directory to collect the Localizable.strings files before
445 # they are copied to the bundle.
446 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
447 # The reason we are not enumerating all the locales is that
448 # the translations would eat up 3.5MB disk space in the
449 # application bundle:
450 'available_locales': 'en',
453 # TODO: remove this helper when we have loops in GYP
454 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
457 # TODO: remove this helper when we have loops in GYP
458 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
466 'Copy the Localizable.strings files to the manifest bundle',
467 'process_outputs_as_mac_bundle_resources': 1,