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 # GN version: //components/policy:policy_component
38 'target_name': 'policy_component',
41 'policy_component_common',
42 'policy_component_browser',
46 # GN version: //components/policy:policy_component_common
47 'target_name': 'policy_component_common',
48 'type': 'static_library',
50 'policy/policy_common.gypi',
54 # GN version: //components/policy:policy_component_browser
55 'target_name': 'policy_component_browser',
56 'type': 'static_library',
58 'policy_component_common',
61 'policy/policy_browser.gypi',
65 }, { # component=="static_library"
68 # GN version: //components/policy:policy_component
69 'target_name': 'policy_component',
70 'type': 'shared_library',
72 'policy/policy_common.gypi',
73 'policy/policy_browser.gypi',
77 # GN version: //components/policy:policy_component_common
78 'target_name': 'policy_component_common',
85 # GN version: //components/policy:policy_component_browser
86 'target_name': 'policy_component_browser',
94 ['configuration_policy==1', {
97 # GN version: //components/policy:cloud_policy_code_generate
98 'target_name': 'cloud_policy_code_generate',
103 'policy/resources/policy_templates.json',
104 '<(generate_policy_source_script_path)',
107 '<(policy_constant_header_path)',
108 '<(policy_constant_source_path)',
109 '<(protobuf_decoder_path)',
110 '<(chrome_settings_proto_path)',
111 '<(cloud_policy_proto_path)',
113 'action_name': 'generate_policy_source',
116 '<@(generate_policy_source_script_path)',
117 '--policy-constants-header=<(policy_constant_header_path)',
118 '--policy-constants-source=<(policy_constant_source_path)',
119 '--chrome-settings-protobuf=<(chrome_settings_proto_path)',
120 '--cloud-policy-protobuf=<(cloud_policy_proto_path)',
121 '--cloud-policy-decoder=<(protobuf_decoder_path)',
124 'policy/resources/policy_templates.json',
126 'message': 'Generating policy source',
129 'direct_dependent_settings': {
137 # GN version: //components/policy:cloud_policy_proto_generated_compile
138 'target_name': 'cloud_policy_proto_generated_compile',
139 'type': '<(component)',
141 '<(cloud_policy_proto_path)',
144 'proto_in_dir': '<(policy_out_dir)/policy',
145 'proto_out_dir': 'policy/proto',
146 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
147 'cc_include': 'components/policy/policy_proto_export.h',
150 'cloud_policy_code_generate',
153 '../build/protoc.gypi',
156 'POLICY_PROTO_COMPILATION',
158 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
159 'msvs_disabled_warnings': [4267, ],
162 # This target builds the "full" protobuf, used for tests only.
163 # GN version: //components/policy:chrome_settings_proto_generated_compile
164 'target_name': 'chrome_settings_proto_generated_compile',
165 'type': 'static_library',
167 '<(chrome_settings_proto_path)',
170 'proto_in_dir': '<(policy_out_dir)/policy',
171 'proto_out_dir': 'policy/proto',
174 'cloud_policy_code_generate',
175 'cloud_policy_proto_generated_compile',
178 '../build/protoc.gypi',
182 # GN version: //components/policy
183 'target_name': 'policy',
184 'type': 'static_library',
185 'hard_dependency': 1,
186 'direct_dependent_settings': {
193 '<(policy_constant_header_path)',
194 '<(policy_constant_source_path)',
195 '<(protobuf_decoder_path)',
201 'cloud_policy_code_generate',
202 'cloud_policy_proto_generated_compile',
203 '<(DEPTH)/base/base.gyp:base',
204 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
207 'POLICY_COMPONENT_IMPLEMENTATION',
211 # GN version: //components/policy/proto
212 'target_name': 'cloud_policy_proto',
213 'type': '<(component)',
215 'policy/proto/chrome_extension_policy.proto',
216 'policy/proto/device_management_backend.proto',
217 'policy/proto/device_management_local.proto',
218 'policy/proto/policy_signing_key.proto',
221 'proto_in_dir': 'policy/proto',
222 'proto_out_dir': 'policy/proto',
223 'cc_generator_options': 'dllexport_decl=POLICY_PROTO_EXPORT:',
224 'cc_include': 'components/policy/policy_proto_export.h',
227 '../build/protoc.gypi',
230 ['OS=="android" or OS=="ios"', {
232 'policy/proto/chrome_extension_policy.proto',
237 'policy/proto/device_management_local.proto',
242 'POLICY_PROTO_COMPILATION',
246 # GN version: //components/policy:test_support
247 'target_name': 'policy_test_support',
249 'hard_dependency': 1,
250 'direct_dependent_settings': {
257 'chrome_settings_proto_generated_compile',
262 # GN version: //components/policy:policy_component_test_support
263 'target_name': 'policy_component_test_support',
264 'type': 'static_library',
265 # This must be undefined so that POLICY_EXPORT works correctly in
266 # the static_library build.
268 'POLICY_COMPONENT_IMPLEMENTATION',
271 'cloud_policy_proto',
273 'policy_test_support',
274 '../testing/gmock.gyp:gmock',
275 '../testing/gtest.gyp:gtest',
281 'policy/core/browser/configuration_policy_pref_store_test.cc',
282 'policy/core/browser/configuration_policy_pref_store_test.h',
283 'policy/core/common/cloud/mock_cloud_external_data_manager.cc',
284 'policy/core/common/cloud/mock_cloud_external_data_manager.h',
285 'policy/core/common/cloud/mock_cloud_policy_client.cc',
286 'policy/core/common/cloud/mock_cloud_policy_client.h',
287 'policy/core/common/cloud/mock_cloud_policy_store.cc',
288 'policy/core/common/cloud/mock_cloud_policy_store.h',
289 'policy/core/common/cloud/mock_device_management_service.cc',
290 'policy/core/common/cloud/mock_device_management_service.h',
291 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
292 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
293 'policy/core/common/cloud/policy_builder.cc',
294 'policy/core/common/cloud/policy_builder.h',
295 'policy/core/common/configuration_policy_provider_test.cc',
296 'policy/core/common/configuration_policy_provider_test.h',
297 'policy/core/common/mock_configuration_policy_provider.cc',
298 'policy/core/common/mock_configuration_policy_provider.h',
299 'policy/core/common/mock_policy_service.cc',
300 'policy/core/common/mock_policy_service.h',
301 'policy/core/common/policy_test_utils.cc',
302 'policy/core/common/policy_test_utils.h',
303 'policy/core/common/preferences_mock_mac.cc',
304 'policy/core/common/preferences_mock_mac.h',
309 'policy/core/common/cloud/mock_user_cloud_policy_store.cc',
310 'policy/core/common/cloud/mock_user_cloud_policy_store.h',
317 ['OS=="win" and target_arch=="ia32" and configuration_policy==1', {
320 'target_name': 'policy_win64',
321 'type': 'static_library',
322 'hard_dependency': 1,
324 '<(policy_constant_header_path)',
325 '<(policy_constant_source_path)',
330 'direct_dependent_settings': {
336 'cloud_policy_code_generate',
340 'msvs_target_platform': 'x64',
346 ['OS=="win" or OS=="mac" or OS=="linux"', {
349 # policy_templates has different inputs and outputs, so it can't use
350 # the rules of chrome_strings
351 'target_name': 'policy_templates',
354 'grit_grd_file': 'policy/resources/policy_templates.grd',
357 '<(DEPTH)/tools/grit/grit_info.py',
362 '../build/grit_target.gypi',
366 'action_name': 'policy_templates',
368 '../build/grit_action.gypi',
378 # This is the bundle of the manifest file of Chrome.
379 # It contains the manifest file and its string tables.
380 'target_name': 'chrome_manifest_bundle',
381 'type': 'loadable_module',
383 'product_extension': 'manifest',
384 'product_name': '<(mac_bundle_id)',
386 # This avoids stripping debugging symbols from the target, which
387 # would fail because there is no binary code here.
391 # Provides app-Manifest.plist and its string tables:
396 'action_name': 'Copy MCX manifest file to manifest bundle',
398 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist',
401 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest',
404 # Use plutil -convert xml1 to put the plist into Apple's
405 # canonical format. As a side effect, this ensures that the
406 # plist is well-formed.
415 'Copying the MCX policy manifest file to the manifest bundle',
416 'process_outputs_as_mac_bundle_resources': 1,
420 'Copy Localizable.strings files to manifest bundle',
422 'input_path': '<(grit_out_dir)/app/policy/mac/strings',
423 # Directory to collect the Localizable.strings files before
424 # they are copied to the bundle.
425 'output_path': '<(INTERMEDIATE_DIR)/app_manifest',
426 # The reason we are not enumerating all the locales is that
427 # the translations would eat up 3.5MB disk space in the
428 # application bundle:
429 'available_locales': 'en',
432 # TODO: remove this helper when we have loops in GYP
433 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
436 # TODO: remove this helper when we have loops in GYP
437 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))',
445 'Copy the Localizable.strings files to the manifest bundle',
446 'process_outputs_as_mac_bundle_resources': 1,