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': 'static_library',
133 '<(cloud_policy_proto_path)',
136 'proto_in_dir': '<(policy_out_dir)/policy',
137 'proto_out_dir': 'policy/proto',
140 'cloud_policy_code_generate',
143 '../build/protoc.gypi',
145 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
146 'msvs_disabled_warnings': [4267, ],
149 # This target builds the "full" protobuf, used for tests only.
150 'target_name': 'chrome_settings_proto_generated_compile',
151 'type': 'static_library',
153 '<(chrome_settings_proto_path)',
156 'proto_in_dir': '<(policy_out_dir)/policy',
157 'proto_out_dir': 'policy/proto',
160 'cloud_policy_code_generate',
161 'cloud_policy_proto_generated_compile',
164 '../build/protoc.gypi',
168 'target_name': 'policy',
169 'type': 'static_library',
170 'hard_dependency': 1,
171 'direct_dependent_settings': {
178 '<(policy_constant_header_path)',
179 '<(policy_constant_source_path)',
180 '<(protobuf_decoder_path)',
186 'cloud_policy_code_generate',
187 'cloud_policy_proto_generated_compile',
188 '<(DEPTH)/base/base.gyp:base',
189 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
192 'POLICY_COMPONENT_IMPLEMENTATION',
196 'target_name': 'cloud_policy_proto',
197 'type': 'static_library',
199 'policy/proto/chrome_extension_policy.proto',
200 'policy/proto/device_management_backend.proto',
201 'policy/proto/device_management_local.proto',
202 'policy/proto/policy_signing_key.proto',
205 'proto_in_dir': 'policy/proto',
206 'proto_out_dir': 'policy/proto',
209 '../build/protoc.gypi',
212 ['OS=="android" or OS=="ios"', {
214 'policy/proto/chrome_extension_policy.proto',
219 'policy/proto/device_management_local.proto',
225 'target_name': 'policy_test_support',
227 'hard_dependency': 1,
228 'direct_dependent_settings': {
235 'chrome_settings_proto_generated_compile',
240 'target_name': 'policy_component_test_support',
241 'type': 'static_library',
242 # This must be undefined so that POLICY_EXPORT works correctly in
243 # the static_library build.
245 'POLICY_COMPONENT_IMPLEMENTATION',
248 'cloud_policy_proto',
250 'policy_test_support',
251 '../testing/gmock.gyp:gmock',
252 '../testing/gtest.gyp:gtest',
258 'policy/core/browser/configuration_policy_pref_store_test.cc',
259 'policy/core/browser/configuration_policy_pref_store_test.h',
260 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
261 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
262 'policy/core/common/cloud/mock_cloud_policy_client.cc',
263 'policy/core/common/cloud/mock_cloud_policy_client.h',
264 'policy/core/common/cloud/mock_cloud_policy_store.cc',
265 'policy/core/common/cloud/mock_cloud_policy_store.h',
266 'policy/core/common/cloud/mock_device_management_service.cc',
267 'policy/core/common/cloud/mock_device_management_service.h',
268 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
269 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
270 'policy/core/common/cloud/policy_builder.cc',
271 'policy/core/common/cloud/policy_builder.h',
272 'policy/core/common/configuration_policy_provider_test.cc',
273 'policy/core/common/configuration_policy_provider_test.h',
274 'policy/core/common/mock_configuration_policy_provider.cc',
275 'policy/core/common/mock_configuration_policy_provider.h',
276 'policy/core/common/mock_policy_service.cc',
277 'policy/core/common/mock_policy_service.h',
278 'policy/core/common/policy_test_utils.cc',
279 'policy/core/common/policy_test_utils.h',
280 'policy/core/common/preferences_mock_mac.cc',
281 'policy/core/common/preferences_mock_mac.h',
286 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
287 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
294 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
297 'target_name': 'policy_win64',
298 'type': 'static_library',
299 'hard_dependency': 1,
301 '<(policy_constant_header_path)',
302 '<(policy_constant_source_path)',
307 'direct_dependent_settings': {
313 'cloud_policy_code_generate',
317 'msvs_target_platform': 'x64',
323 ['OS=="win" or OS=="mac" or OS=="linux"', {
326 # policy_templates has different inputs and outputs, so it can't use
327 # the rules of chrome_strings
328 'target_name': 'policy_templates',
331 'grit_grd_file': 'policy/resources/policy_templates.grd',
334 '<(DEPTH)/tools/grit/grit_info.py',
339 '../build/grit_target.gypi',
343 'action_name': 'policy_templates',
345 '../build/grit_action.gypi',
355 # This is the bundle of the manifest file of Chrome.
356 # It contains the manifest file and its string tables.
357 'target_name': 'chrome_manifest_bundle',
358 'type': 'loadable_module',
360 'product_extension': 'manifest',
361 'product_name': '<(mac_bundle_id)',
363 # This avoids stripping debugging symbols from the target, which
364 # would fail because there is no binary code here.
368 # Provides app-Manifest.plist and its string tables:
373 'action_name': 'Copy MCX manifest file to manifest bundle',
375 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
378 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
381 # Use plutil -convert xml1 to put the plist into Apple's
382 # canonical format. As a side effect, this ensures that the
383 # plist is well-formed.
392 'Copying the MCX policy manifest file to the manifest bundle',
393 'process_outputs_as_mac_bundle_resources': 1,
397 'Copy Localizable.strings files to manifest bundle',
399 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
400 # Directory to collect the Localizable.strings files before
401 # they are copied to the bundle.
402 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
403 # The reason we are not enumerating all the locales is that
404 # the translations would eat up 3.5MB disk space in the
405 # application bundle:
406 'available_locales': 'en',
409 # TODO: remove this helper when we have loops in GYP
410 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
413 # TODO: remove this helper when we have loops in GYP
414 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
422 'Copy the Localizable.strings files to the manifest bundle',
423 'process_outputs_as_mac_bundle_resources': 1,