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',
34 ['component=="static_library"', {
37 'target_name': 'policy_component',
40 'policy_component_common',
41 'policy_component_browser',
45 'target_name': 'policy_component_common',
46 'type': 'static_library',
48 'policy/policy_common.gypi',
52 'target_name': 'policy_component_browser',
53 'type': 'static_library',
55 'policy_component_common',
58 'policy/policy_browser.gypi',
62 }, { # component=="static_library"
65 'target_name': 'policy_component',
66 'type': 'shared_library',
68 'policy/policy_common.gypi',
69 'policy/policy_browser.gypi',
73 'target_name': 'policy_component_common',
80 'target_name': 'policy_component_browser',
88 ['configuration_policy==1', {
91 'target_name': 'cloud_policy_code_generate',
96 'policy/resources/policy_templates.json',
97 '<(generate_policy_source_script_path)',
100 '<(policy_constant_header_path)',
101 '<(policy_constant_source_path)',
102 '<(protobuf_decoder_path)',
103 '<(chrome_settings_proto_path)',
104 '<(cloud_policy_proto_path)',
106 'action_name': 'generate_policy_source',
109 '<@(generate_policy_source_script_path)',
110 '--policy-constants-header=<(policy_constant_header_path)',
111 '--policy-constants-source=<(policy_constant_source_path)',
112 '--chrome-settings-protobuf=<(chrome_settings_proto_path)',
113 '--cloud-policy-protobuf=<(cloud_policy_proto_path)',
114 '--cloud-policy-decoder=<(protobuf_decoder_path)',
117 'policy/resources/policy_templates.json',
119 'message': 'Generating policy source',
122 'direct_dependent_settings': {
130 'target_name': 'cloud_policy_proto_generated_compile',
131 'type': '<(component)',
133 '<(cloud_policy_proto_path)',
136 'proto_in_dir': '<(policy_out_dir)/policy',
137 'proto_out_dir': 'policy/proto',
138 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
139 'cc_include': 'components/policy/policy_proto_export.h',
142 'cloud_policy_code_generate',
145 '../build/protoc.gypi',
148 'POLICY_PROTO_COMPILATION',
150 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
151 'msvs_disabled_warnings': [4267, ],
154 # This target builds the "full" protobuf, used for tests only.
155 'target_name': 'chrome_settings_proto_generated_compile',
156 'type': 'static_library',
158 '<(chrome_settings_proto_path)',
161 'proto_in_dir': '<(policy_out_dir)/policy',
162 'proto_out_dir': 'policy/proto',
165 'cloud_policy_code_generate',
166 'cloud_policy_proto_generated_compile',
169 '../build/protoc.gypi',
173 'target_name': 'policy',
174 'type': 'static_library',
175 'hard_dependency': 1,
176 'direct_dependent_settings': {
183 '<(policy_constant_header_path)',
184 '<(policy_constant_source_path)',
185 '<(protobuf_decoder_path)',
191 'cloud_policy_code_generate',
192 'cloud_policy_proto_generated_compile',
193 '<(DEPTH)/base/base.gyp:base',
194 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
197 'POLICY_COMPONENT_IMPLEMENTATION',
201 'target_name': 'cloud_policy_proto',
202 'type': '<(component)',
204 'policy/proto/chrome_extension_policy.proto',
205 'policy/proto/device_management_backend.proto',
206 'policy/proto/device_management_local.proto',
207 'policy/proto/policy_signing_key.proto',
210 'proto_in_dir': 'policy/proto',
211 'proto_out_dir': 'policy/proto',
212 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
213 'cc_include': 'components/policy/policy_proto_export.h',
216 '../build/protoc.gypi',
219 ['OS=="android" or OS=="ios"', {
221 'policy/proto/chrome_extension_policy.proto',
226 'policy/proto/device_management_local.proto',
231 'POLICY_PROTO_COMPILATION',
235 'target_name': 'policy_test_support',
237 'hard_dependency': 1,
238 'direct_dependent_settings': {
245 'chrome_settings_proto_generated_compile',
250 'target_name': 'policy_component_test_support',
251 'type': 'static_library',
252 # This must be undefined so that POLICY_EXPORT works correctly in
253 # the static_library build.
255 'POLICY_COMPONENT_IMPLEMENTATION',
258 'cloud_policy_proto',
260 'policy_test_support',
261 '../testing/gmock.gyp:gmock',
262 '../testing/gtest.gyp:gtest',
268 'policy/core/browser/configuration_policy_pref_store_test.cc',
269 'policy/core/browser/configuration_policy_pref_store_test.h',
270 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
271 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
272 'policy/core/common/cloud/mock_cloud_policy_client.cc',
273 'policy/core/common/cloud/mock_cloud_policy_client.h',
274 'policy/core/common/cloud/mock_cloud_policy_store.cc',
275 'policy/core/common/cloud/mock_cloud_policy_store.h',
276 'policy/core/common/cloud/mock_device_management_service.cc',
277 'policy/core/common/cloud/mock_device_management_service.h',
278 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
279 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
280 'policy/core/common/cloud/policy_builder.cc',
281 'policy/core/common/cloud/policy_builder.h',
282 'policy/core/common/configuration_policy_provider_test.cc',
283 'policy/core/common/configuration_policy_provider_test.h',
284 'policy/core/common/mock_configuration_policy_provider.cc',
285 'policy/core/common/mock_configuration_policy_provider.h',
286 'policy/core/common/mock_policy_service.cc',
287 'policy/core/common/mock_policy_service.h',
288 'policy/core/common/policy_test_utils.cc',
289 'policy/core/common/policy_test_utils.h',
290 'policy/core/common/preferences_mock_mac.cc',
291 'policy/core/common/preferences_mock_mac.h',
296 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
297 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
304 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
307 'target_name': 'policy_win64',
308 'type': 'static_library',
309 'hard_dependency': 1,
311 '<(policy_constant_header_path)',
312 '<(policy_constant_source_path)',
317 'direct_dependent_settings': {
323 'cloud_policy_code_generate',
327 'msvs_target_platform': 'x64',
333 ['OS=="win" or OS=="mac" or OS=="linux"', {
336 # policy_templates has different inputs and outputs, so it can't use
337 # the rules of chrome_strings
338 'target_name': 'policy_templates',
341 'grit_grd_file': 'policy/resources/policy_templates.grd',
344 '<(DEPTH)/tools/grit/grit_info.py',
349 '../build/grit_target.gypi',
353 'action_name': 'policy_templates',
355 '../build/grit_action.gypi',
365 # This is the bundle of the manifest file of Chrome.
366 # It contains the manifest file and its string tables.
367 'target_name': 'chrome_manifest_bundle',
368 'type': 'loadable_module',
370 'product_extension': 'manifest',
371 'product_name': '<(mac_bundle_id)',
373 # This avoids stripping debugging symbols from the target, which
374 # would fail because there is no binary code here.
378 # Provides app-Manifest.plist and its string tables:
383 'action_name': 'Copy MCX manifest file to manifest bundle',
385 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
388 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
391 # Use plutil -convert xml1 to put the plist into Apple's
392 # canonical format. As a side effect, this ensures that the
393 # plist is well-formed.
402 'Copying the MCX policy manifest file to the manifest bundle',
403 'process_outputs_as_mac_bundle_resources': 1,
407 'Copy Localizable.strings files to manifest bundle',
409 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
410 # Directory to collect the Localizable.strings files before
411 # they are copied to the bundle.
412 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
413 # The reason we are not enumerating all the locales is that
414 # the translations would eat up 3.5MB disk space in the
415 # application bundle:
416 'available_locales': 'en',
419 # TODO: remove this helper when we have loops in GYP
420 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
423 # TODO: remove this helper when we have loops in GYP
424 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
432 'Copy the Localizable.strings files to the manifest bundle',
433 'process_outputs_as_mac_bundle_resources': 1,