OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'includes': [ | |
7 # Included to get 'mac_bundle_id' and other variables. | |
8 '../build/chrome_settings.gypi', | |
9 ], | |
10 'variables': { | |
11 'chromium_code': 1, | |
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 | |
29 # and compiled. | |
30 'cloud_policy_proto_path': | |
31 '<(policy_out_dir)/policy/cloud_policy.proto', | |
32 }, | |
6 'targets': [ | 33 'targets': [ |
7 { | 34 { |
35 'target_name': 'cloud_policy_code_generate', | |
36 'type': 'none', | |
37 'actions': [ | |
38 { | |
39 'inputs': [ | |
40 'policy/resources/policy_templates.json', | |
41 '<(generate_policy_source_script_path)', | |
42 ], | |
43 'outputs': [ | |
44 '<(policy_constant_header_path)', | |
45 '<(policy_constant_source_path)', | |
46 '<(protobuf_decoder_path)', | |
47 '<(chrome_settings_proto_path)', | |
48 '<(cloud_policy_proto_path)', | |
49 ], | |
50 'action_name': 'generate_policy_source', | |
51 'action': [ | |
52 'python', | |
53 '<@(generate_policy_source_script_path)', | |
54 '--policy-constants-header=<(policy_constant_header_path)', | |
55 '--policy-constants-source=<(policy_constant_source_path)', | |
56 '--chrome-settings-protobuf=<(chrome_settings_proto_path)', | |
57 '--cloud-policy-protobuf=<(cloud_policy_proto_path)', | |
58 '--cloud-policy-decoder=<(protobuf_decoder_path)', | |
59 '<(OS)', | |
60 '<(chromeos)', | |
61 'policy/resources/policy_templates.json', | |
62 ], | |
63 'message': 'Generating policy source', | |
64 }, | |
65 ], | |
66 'direct_dependent_settings': { | |
67 'include_dirs': [ | |
68 '<(policy_out_dir)', | |
69 '<(protoc_out_dir)', | |
70 ], | |
71 }, | |
72 }, | |
73 { | |
74 'target_name': 'cloud_policy_proto_generated_compile', | |
75 'type': 'static_library', | |
76 'sources': [ | |
77 '<(cloud_policy_proto_path)', | |
78 ], | |
79 'variables': { | |
80 'proto_in_dir': '<(policy_out_dir)/policy', | |
81 'proto_out_dir': 'policy/proto', | |
82 }, | |
83 'dependencies': [ | |
84 'cloud_policy_code_generate', | |
85 ], | |
86 'includes': [ | |
87 '../build/protoc.gypi', | |
88 ], | |
89 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | |
90 'msvs_disabled_warnings': [4267, ], | |
91 }, | |
92 { | |
93 # This target builds the "full" protobuf, used for tests only. | |
94 'target_name': 'chrome_settings_proto_generated_compile', | |
95 'type': 'static_library', | |
96 'sources': [ | |
97 '<(chrome_settings_proto_path)', | |
98 ], | |
99 'variables': { | |
100 'proto_in_dir': '<(policy_out_dir)/policy', | |
101 'proto_out_dir': 'policy/proto', | |
102 }, | |
103 'dependencies': [ | |
104 'cloud_policy_code_generate', | |
105 'cloud_policy_proto_generated_compile', | |
106 ], | |
107 'includes': [ | |
108 '../build/protoc.gypi', | |
109 ], | |
110 }, | |
111 { | |
112 # TODO: consider merging with policy_component | |
113 # Maybe use 'export_dependent_settings' to make it easier | |
Joao da Silva
2013/12/12 08:27:02
Meh, forgot to remove these comments to self; I'll
Mattias Nissler (ping if slow)
2013/12/12 14:11:38
FWIW, if this gets built even if configuratin_poli
Joao da Silva
2013/12/12 14:53:23
Agreed. Let's leave it for another CL to reduce ri
| |
114 'target_name': 'policy', | |
Mattias Nissler (ping if slow)
2013/12/12 14:11:38
It'd be great if we could rename this to policy_co
Joao da Silva
2013/12/12 14:53:23
SGTM. If this gets merged into policy_component th
| |
115 'type': 'static_library', | |
116 'hard_dependency': 1, | |
117 'direct_dependent_settings': { | |
118 'include_dirs': [ | |
119 '<(policy_out_dir)', | |
120 '<(protoc_out_dir)', | |
121 ], | |
122 }, | |
123 'sources': [ | |
124 '<(policy_constant_header_path)', | |
125 '<(policy_constant_source_path)', | |
126 '<(protobuf_decoder_path)', | |
127 ], | |
128 'include_dirs': [ | |
129 '<(DEPTH)', | |
130 ], | |
131 'dependencies': [ | |
132 'cloud_policy_code_generate', | |
133 'cloud_policy_proto_generated_compile', | |
134 '<(DEPTH)/base/base.gyp:base', | |
135 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite', | |
136 ], | |
137 }, | |
138 { | |
8 'target_name': 'policy_component', | 139 'target_name': 'policy_component', |
9 'type': '<(component)', | 140 'type': '<(component)', |
10 'dependencies': [ | 141 'dependencies': [ |
11 '../base/base.gyp:base', | 142 '../base/base.gyp:base', |
12 ], | 143 ], |
13 'defines': [ | 144 'defines': [ |
14 'POLICY_COMPONENT_IMPLEMENTATION', | 145 'POLICY_COMPONENT_IMPLEMENTATION', |
15 ], | 146 ], |
16 'include_dirs': [ | 147 'include_dirs': [ |
17 '..', | 148 '..', |
18 ], | 149 ], |
19 'conditions': [ | 150 'conditions': [ |
20 ['configuration_policy==1', { | 151 ['configuration_policy==1', { |
21 'dependencies': [ | 152 'dependencies': [ |
22 '../base/base.gyp:base_prefs', | 153 '../base/base.gyp:base_prefs', |
23 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dyn amic_annotations', | 154 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dyn amic_annotations', |
24 # TODO(joaodasilva): remove this dependency on the user policy proto buf. | |
25 '../chrome/app/policy/cloud_policy_codegen.gyp:policy', | |
26 '../google_apis/google_apis.gyp:google_apis', | 155 '../google_apis/google_apis.gyp:google_apis', |
27 '../ui/ui.gyp:ui', | 156 '../ui/ui.gyp:ui', |
28 '../url/url.gyp:url_lib', | 157 '../url/url.gyp:url_lib', |
29 'component_strings.gyp:component_strings', | 158 'component_strings.gyp:component_strings', |
30 'cloud_policy_proto', | 159 'cloud_policy_proto', |
31 'json_schema', | 160 'json_schema', |
161 'policy', | |
32 ], | 162 ], |
33 'sources': [ | 163 'sources': [ |
34 'policy/core/browser/cloud/message_util.cc', | 164 'policy/core/browser/cloud/message_util.cc', |
35 'policy/core/browser/cloud/message_util.h', | 165 'policy/core/browser/cloud/message_util.h', |
36 'policy/core/browser/configuration_policy_handler.cc', | 166 'policy/core/browser/configuration_policy_handler.cc', |
37 'policy/core/browser/configuration_policy_handler.h', | 167 'policy/core/browser/configuration_policy_handler.h', |
38 'policy/core/browser/configuration_policy_handler_list.cc', | 168 'policy/core/browser/configuration_policy_handler_list.cc', |
39 'policy/core/browser/configuration_policy_handler_list.h', | 169 'policy/core/browser/configuration_policy_handler_list.h', |
40 'policy/core/browser/configuration_policy_pref_store.cc', | 170 'policy/core/browser/configuration_policy_pref_store.cc', |
41 'policy/core/browser/configuration_policy_pref_store.h', | 171 'policy/core/browser/configuration_policy_pref_store.h', |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 'type': 'static_library', | 338 'type': 'static_library', |
209 'sources': [ | 339 'sources': [ |
210 'policy/proto/chrome_extension_policy.proto', | 340 'policy/proto/chrome_extension_policy.proto', |
211 'policy/proto/device_management_backend.proto', | 341 'policy/proto/device_management_backend.proto', |
212 'policy/proto/device_management_local.proto', | 342 'policy/proto/device_management_local.proto', |
213 ], | 343 ], |
214 'variables': { | 344 'variables': { |
215 'proto_in_dir': 'policy/proto', | 345 'proto_in_dir': 'policy/proto', |
216 'proto_out_dir': 'policy/proto', | 346 'proto_out_dir': 'policy/proto', |
217 }, | 347 }, |
218 'includes': [ '../build/protoc.gypi' ], | 348 'includes': [ |
349 '../build/protoc.gypi', | |
350 ], | |
219 'conditions': [ | 351 'conditions': [ |
220 ['OS=="android"', { | 352 ['OS=="android"', { |
221 'sources!': [ | 353 'sources!': [ |
222 'policy/proto/chrome_extension_policy.proto', | 354 'policy/proto/chrome_extension_policy.proto', |
223 ], | 355 ], |
224 }], | 356 }], |
225 ['chromeos==0', { | 357 ['chromeos==0', { |
226 'sources!': [ | 358 'sources!': [ |
227 'policy/proto/device_management_local.proto', | 359 'policy/proto/device_management_local.proto', |
228 ], | 360 ], |
229 }], | 361 }], |
230 ], | 362 ], |
231 }, | 363 }, |
364 { | |
365 # TODO: consider merging with policy_component_test_support | |
Joao da Silva
2013/12/12 08:27:02
Same logic here
Mattias Nissler (ping if slow)
2013/12/12 14:11:38
I think in this case, it might be simpler to just
Joao da Silva
2013/12/12 14:53:23
Removed the comment.
| |
366 'target_name': 'policy_test_support', | |
367 'type': 'none', | |
368 'hard_dependency': 1, | |
369 'direct_dependent_settings': { | |
370 'include_dirs': [ | |
371 '<(policy_out_dir)', | |
372 '<(protoc_out_dir)', | |
373 ], | |
374 }, | |
375 'dependencies': [ | |
376 'chrome_settings_proto_generated_compile', | |
377 'policy', | |
378 ], | |
379 }, | |
232 ], | 380 ], |
233 'conditions': [ | 381 'conditions': [ |
382 ['OS=="win" and target_arch=="ia32"', { | |
383 'targets': [ | |
384 { | |
385 'target_name': 'policy_win64', | |
Mattias Nissler (ping if slow)
2013/12/12 14:11:38
If you rename the other one, this should be policy
Joao da Silva
2013/12/12 14:53:23
ack
| |
386 'type': 'static_library', | |
387 'hard_dependency': 1, | |
388 'sources': [ | |
389 '<(policy_constant_header_path)', | |
390 '<(policy_constant_source_path)', | |
391 ], | |
392 'include_dirs': [ | |
393 '<(DEPTH)', | |
394 ], | |
395 'direct_dependent_settings': { | |
396 'include_dirs': [ | |
397 '<(policy_out_dir)' | |
398 ], | |
399 }, | |
400 'dependencies': [ | |
401 'cloud_policy_code_generate', | |
402 ], | |
403 'configurations': { | |
404 'Common_Base': { | |
405 'msvs_target_platform': 'x64', | |
406 }, | |
407 }, | |
408 }, | |
409 ], | |
410 }], | |
234 ['configuration_policy==1', { | 411 ['configuration_policy==1', { |
235 'targets': [ | 412 'targets': [ |
236 { | 413 { |
237 'target_name': 'policy_component_test_support', | 414 'target_name': 'policy_component_test_support', |
238 'type': 'static_library', | 415 'type': 'static_library', |
239 # This must be undefined so that POLICY_EXPORT works correctly in | 416 # This must be undefined so that POLICY_EXPORT works correctly in |
240 # the static_library build. | 417 # the static_library build. |
241 'defines!': [ | 418 'defines!': [ |
242 'POLICY_COMPONENT_IMPLEMENTATION', | 419 'POLICY_COMPONENT_IMPLEMENTATION', |
243 ], | 420 ], |
244 'dependencies': [ | 421 'dependencies': [ |
245 # TODO(joaodasilva): remove this dependency. | |
246 '../chrome/app/policy/cloud_policy_codegen.gyp:policy_test_support', | |
247 'cloud_policy_proto', | 422 'cloud_policy_proto', |
248 'policy_component', | 423 'policy_component', |
424 'policy_test_support', | |
249 '../testing/gmock.gyp:gmock', | 425 '../testing/gmock.gyp:gmock', |
250 '../testing/gtest.gyp:gtest', | 426 '../testing/gtest.gyp:gtest', |
251 ], | 427 ], |
252 'include_dirs': [ | 428 'include_dirs': [ |
253 '..', | 429 '..', |
254 ], | 430 ], |
255 'sources': [ | 431 'sources': [ |
256 'policy/core/common/cloud/mock_cloud_external_data_manager.cc', | 432 'policy/core/common/cloud/mock_cloud_external_data_manager.cc', |
257 'policy/core/common/cloud/mock_cloud_external_data_manager.h', | 433 'policy/core/common/cloud/mock_cloud_external_data_manager.h', |
258 'policy/core/common/cloud/mock_cloud_policy_client.cc', | 434 'policy/core/common/cloud/mock_cloud_policy_client.cc', |
(...skipping 21 matching lines...) Expand all Loading... | |
280 ['chromeos==1', { | 456 ['chromeos==1', { |
281 'sources!': [ | 457 'sources!': [ |
282 'policy/core/common/cloud/mock_user_cloud_policy_store.cc', | 458 'policy/core/common/cloud/mock_user_cloud_policy_store.cc', |
283 'policy/core/common/cloud/mock_user_cloud_policy_store.h', | 459 'policy/core/common/cloud/mock_user_cloud_policy_store.h', |
284 ], | 460 ], |
285 }], | 461 }], |
286 ], | 462 ], |
287 }, | 463 }, |
288 ], | 464 ], |
289 }], | 465 }], |
466 ['OS=="win" or OS=="mac" or OS=="linux"', { | |
467 'targets': [ | |
468 { | |
469 # policy_templates has different inputs and outputs, so it can't use | |
470 # the rules of chrome_strings | |
471 'target_name': 'policy_templates', | |
472 'type': 'none', | |
473 'variables': { | |
474 'grit_grd_file': 'policy/resources/policy_templates.grd', | |
475 'grit_info_cmd': [ | |
476 'python', | |
477 '<(DEPTH)/tools/grit/grit_info.py', | |
478 '<@(grit_defines)', | |
479 ], | |
480 }, | |
481 'includes': [ | |
482 '../build/grit_target.gypi', | |
483 ], | |
484 'actions': [ | |
485 { | |
486 'action_name': 'policy_templates', | |
487 'includes': [ | |
488 '../build/grit_action.gypi', | |
489 ], | |
490 }, | |
491 ], | |
492 'conditions': [ | |
493 ['OS=="win"', { | |
494 'variables': { | |
495 'version_path': '<(grit_out_dir)/app/policy/VERSION', | |
496 'template_files': [ | |
497 '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(grit_grd _file))', | |
498 ], | |
499 }, | |
500 'actions': [ | |
501 { | |
502 'action_name': 'add_version', | |
503 'inputs': [ | |
504 '../chrome/VERSION', | |
Mattias Nissler (ping if slow)
2013/12/12 14:11:38
is this OK to have as dependency in a component?
Joao da Silva
2013/12/12 14:53:23
Good catch.
This certainly works, and we can add
| |
505 ], | |
506 'outputs': [ | |
507 '<(version_path)', | |
508 ], | |
509 'action': [ | |
510 'cp', | |
511 '<@(_inputs)', | |
512 '<@(_outputs)', | |
513 ], | |
514 'msvs_cygwin_shell': 1, | |
515 }, | |
516 { | |
517 # Add all the templates generated at the previous step into | |
518 # a zip archive. | |
519 'action_name': 'pack_templates', | |
520 'variables': { | |
521 'zip_script': 'policy/tools/make_policy_zip.py', | |
522 }, | |
523 'inputs': [ | |
524 '<(version_path)', | |
525 '<@(template_files)', | |
526 '<(zip_script)', | |
527 ], | |
528 'outputs': [ | |
529 '<(PRODUCT_DIR)/policy_templates.zip', | |
530 ], | |
531 'action': [ | |
532 'python', | |
533 '<(zip_script)', | |
534 '--output', | |
535 '<@(_outputs)', | |
536 '--basedir', '<(grit_out_dir)/app/policy', | |
537 # The list of files in the destination zip is derived from | |
538 # the list of output nodes in the following grd file. | |
539 # This whole trickery is necessary because we cannot pass | |
540 # the entire list of file names as command line arguments, | |
541 # because they would exceed the length limit on Windows. | |
542 '--grd_input', | |
543 '<(grit_grd_file)', | |
544 '--grd_strip_path_prefix', | |
545 'app/policy', | |
546 '--extra_input', | |
547 'VERSION', | |
548 # Module to be used to process grd_input'. | |
549 '--grit_info', | |
550 '<(DEPTH)/tools/grit/grit_info.py', | |
551 '<@(grit_defines)', | |
552 ], | |
553 'message': 'Packing generated templates into <(_outputs)', | |
554 'msvs_cygwin_shell': 1, | |
Joao da Silva
2013/12/12 08:27:02
This breaks the presubmit scripts but can be safel
| |
555 } | |
556 ] | |
557 }], | |
558 ], | |
559 }, | |
560 ], | |
561 }], | |
562 ['OS=="mac"', { | |
563 'targets': [ | |
564 { | |
565 # This is the bundle of the manifest file of Chrome. | |
566 # It contains the manifest file and its string tables. | |
567 'target_name': 'chrome_manifest_bundle', | |
568 'type': 'loadable_module', | |
569 'mac_bundle': 1, | |
570 'product_extension': 'manifest', | |
571 'product_name': '<(mac_bundle_id)', | |
572 'variables': { | |
573 # This avoids stripping debugging symbols from the target, which | |
574 # would fail because there is no binary code here. | |
575 'mac_strip': 0, | |
576 }, | |
577 'dependencies': [ | |
578 # Provides app-Manifest.plist and its string tables: | |
579 'policy_templates', | |
580 ], | |
581 'actions': [ | |
582 { | |
583 'action_name': 'Copy MCX manifest file to manifest bundle', | |
584 'inputs': [ | |
585 '<(grit_out_dir)/app/policy/mac/app-Manifest.plist', | |
586 ], | |
587 'outputs': [ | |
588 '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest', | |
589 ], | |
590 'action': [ | |
591 # Use plutil -convert xml1 to put the plist into Apple's | |
592 # canonical format. As a side effect, this ensures that the | |
593 # plist is well-formed. | |
594 'plutil', | |
595 '-convert', | |
596 'xml1', | |
597 '<@(_inputs)', | |
598 '-o', | |
599 '<@(_outputs)', | |
600 ], | |
601 'message': | |
602 'Copying the MCX policy manifest file to the manifest bundle', | |
603 'process_outputs_as_mac_bundle_resources': 1, | |
604 }, | |
605 { | |
606 'action_name': | |
607 'Copy Localizable.strings files to manifest bundle', | |
608 'variables': { | |
609 'input_path': '<(grit_out_dir)/app/policy/mac/strings', | |
610 # Directory to collect the Localizable.strings files before | |
611 # they are copied to the bundle. | |
612 'output_path': '<(INTERMEDIATE_DIR)/app_manifest', | |
613 # The reason we are not enumerating all the locales is that | |
614 # the translations would eat up 3.5MB disk space in the | |
615 # application bundle: | |
616 'available_locales': 'en', | |
617 }, | |
618 'inputs': [ | |
619 # TODO: remove this helper when we have loops in GYP | |
620 '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Loca lizable.strings\' <(available_locales))', | |
621 ], | |
622 'outputs': [ | |
623 # TODO: remove this helper when we have loops in GYP | |
624 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Loc alizable.strings\' <(available_locales))', | |
625 ], | |
626 'action': [ | |
627 'cp', '-R', | |
628 '<(input_path)/', | |
629 '<(output_path)', | |
630 ], | |
631 'message': | |
632 'Copy the Localizable.strings files to the manifest bundle', | |
633 'process_outputs_as_mac_bundle_resources': 1, | |
634 'msvs_cygwin_shell': 1, | |
635 }, | |
636 ], | |
637 }, | |
638 ] | |
639 }] | |
290 ], | 640 ], |
291 } | 641 } |
OLD | NEW |