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/common/cloud/mock_cloud_external_data_manager.cc',
259 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
260 'policy/core/common/cloud/mock_cloud_policy_client.cc',
261 'policy/core/common/cloud/mock_cloud_policy_client.h',
262 'policy/core/common/cloud/mock_cloud_policy_store.cc',
263 'policy/core/common/cloud/mock_cloud_policy_store.h',
264 'policy/core/common/cloud/mock_device_management_service.cc',
265 'policy/core/common/cloud/mock_device_management_service.h',
266 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
267 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
268 'policy/core/common/cloud/policy_builder.cc',
269 'policy/core/common/cloud/policy_builder.h',
270 'policy/core/common/configuration_policy_provider_test.cc',
271 'policy/core/common/configuration_policy_provider_test.h',
272 'policy/core/common/mock_configuration_policy_provider.cc',
273 'policy/core/common/mock_configuration_policy_provider.h',
274 'policy/core/common/mock_policy_service.cc',
275 'policy/core/common/mock_policy_service.h',
276 'policy/core/common/policy_test_utils.cc',
277 'policy/core/common/policy_test_utils.h',
278 'policy/core/common/preferences_mock_mac.cc',
279 'policy/core/common/preferences_mock_mac.h',
284 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
285 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
292 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
295 'target_name': 'policy_win64',
296 'type': 'static_library',
297 'hard_dependency': 1,
299 '<(policy_constant_header_path)',
300 '<(policy_constant_source_path)',
305 'direct_dependent_settings': {
311 'cloud_policy_code_generate',
315 'msvs_target_platform': 'x64',
321 ['OS=="win" or OS=="mac" or OS=="linux"', {
324 # policy_templates has different inputs and outputs, so it can't use
325 # the rules of chrome_strings
326 'target_name': 'policy_templates',
329 'grit_grd_file': 'policy/resources/policy_templates.grd',
332 '<(DEPTH)/tools/grit/grit_info.py',
337 '../build/grit_target.gypi',
341 'action_name': 'policy_templates',
343 '../build/grit_action.gypi',
353 # This is the bundle of the manifest file of Chrome.
354 # It contains the manifest file and its string tables.
355 'target_name': 'chrome_manifest_bundle',
356 'type': 'loadable_module',
358 'product_extension': 'manifest',
359 'product_name': '<(mac_bundle_id)',
361 # This avoids stripping debugging symbols from the target, which
362 # would fail because there is no binary code here.
366 # Provides app-Manifest.plist and its string tables:
371 'action_name': 'Copy MCX manifest file to manifest bundle',
373 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
376 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
379 # Use plutil -convert xml1 to put the plist into Apple's
380 # canonical format. As a side effect, this ensures that the
381 # plist is well-formed.
390 'Copying the MCX policy manifest file to the manifest bundle',
391 'process_outputs_as_mac_bundle_resources': 1,
395 'Copy Localizable.strings files to manifest bundle',
397 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
398 # Directory to collect the Localizable.strings files before
399 # they are copied to the bundle.
400 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
401 # The reason we are not enumerating all the locales is that
402 # the translations would eat up 3.5MB disk space in the
403 # application bundle:
404 'available_locales': 'en',
407 # TODO: remove this helper when we have loops in GYP
408 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
411 # TODO: remove this helper when we have loops in GYP
412 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
420 'Copy the Localizable.strings files to the manifest bundle',
421 'process_outputs_as_mac_bundle_resources': 1,