Android: add UMA instrumentation for inertial sensors.
[chromium-blink-merge.git] / chrome / chrome_installer.gypi
blobc424e77d96e06d05fbe4c223ba2ba2cd66aa2bd7
1 # Copyright (c) 2012 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.
6   'variables': {
7     'lastchange_path': '../build/util/LASTCHANGE',
8     'libpeer_target_type%': 'static_library',
9     # 'branding_dir' is set in the 'conditions' section at the bottom.
10   },
11   'conditions': [
12     ['OS=="win"', {
13       'targets': [
14         {
15           'target_name': 'gcapi_dll',
16           'type': 'loadable_module',
17           'dependencies': [
18             'gcapi_lib',
19           ],
20           'include_dirs': [
21             '..',
22           ],
23           'sources': [
24             'installer/gcapi/gcapi.def',
25             'installer/gcapi/gcapi_dll.cc',
26           ],
27         },
28         {
29           'target_name': 'gcapi_lib',
30           'type': 'static_library',
31           'dependencies': [
32             'installer_util',
33             '../base/base.gyp:base',
34             '../chrome/chrome.gyp:launcher_support',
35             '../google_update/google_update.gyp:google_update',
36           ],
37           'include_dirs': [
38             '..',
39           ],
40           'sources': [
41             'installer/gcapi/gcapi.cc',
42             'installer/gcapi/gcapi.h',
43             'installer/gcapi/gcapi_omaha_experiment.cc',
44             'installer/gcapi/gcapi_omaha_experiment.h',
45             'installer/gcapi/gcapi_reactivation.cc',
46             'installer/gcapi/gcapi_reactivation.h',
47           ],
48           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
49           'msvs_disabled_warnings': [ 4267, ],
50         },
51         {
52           'target_name': 'gcapi_test',
53           'type': 'executable',
54           'dependencies': [
55             'common',
56             'gcapi_dll',
57             'gcapi_lib',
58             'installer_util',
59             '../base/base.gyp:base',
60             '../base/base.gyp:test_support_base',
61             '../testing/gtest.gyp:gtest',
62           ],
63           'include_dirs': [
64             '..',
65           ],
66           'sources': [
67             'installer/gcapi/gcapi_last_run_test.cc',
68             'installer/gcapi/gcapi_omaha_experiment_test.cc',
69             'installer/gcapi/gcapi_reactivation_test.cc',
70             'installer/gcapi/gcapi_test_registry_overrider.cc',
71             'installer/gcapi/gcapi_test_registry_overrider.h',
72             'installer/gcapi/gcapi_test.cc',
73             'installer/gcapi/gcapi_test.rc',
74             'installer/gcapi/resource.h',
75           ],
76         },
77         {
78           'target_name': 'installer_util_unittests',
79           'type': 'executable',
80           'dependencies': [
81             'installer_util',
82             'installer_util_strings',
83             'installer/upgrade_test.gyp:alternate_version_generator_lib',
84             '../base/base.gyp:base',
85             '../base/base.gyp:base_i18n',
86             '../base/base.gyp:test_support_base',
87             '../chrome/chrome.gyp:chrome_version_resources',
88             '../content/content.gyp:content_common',
89             '../testing/gmock.gyp:gmock',
90             '../testing/gtest.gyp:gtest',
91           ],
92           'include_dirs': [
93             '..',
94           ],
95           'sources': [
96             'installer/setup/compat_checks_unittest.cc',
97             'installer/setup/setup_constants.cc',
98             'installer/util/callback_work_item_unittest.cc',
99             'installer/util/channel_info_unittest.cc',
100             'installer/util/copy_reg_key_work_item_unittest.cc',
101             'installer/util/copy_tree_work_item_unittest.cc',
102             'installer/util/create_dir_work_item_unittest.cc',
103             'installer/util/create_reg_key_work_item_unittest.cc',
104             'installer/util/delete_after_reboot_helper_unittest.cc',
105             'installer/util/delete_reg_key_work_item_unittest.cc',
106             'installer/util/delete_reg_value_work_item_unittest.cc',
107             'installer/util/delete_tree_work_item_unittest.cc',
108             'installer/util/duplicate_tree_detector_unittest.cc',
109             'installer/util/fake_installation_state.h',
110             'installer/util/fake_product_state.h',
111             'installer/util/google_update_settings_unittest.cc',
112             'installer/util/install_util_unittest.cc',
113             'installer/util/installation_validation_helper.cc',
114             'installer/util/installation_validation_helper.h',
115             'installer/util/installation_validator_unittest.cc',
116             'installer/util/installer_state_unittest.cc',
117             'installer/util/installer_util_test_common.cc',
118             'installer/util/installer_util_test_common.h',
119             'installer/util/installer_util_unittests.rc',
120             'installer/util/installer_util_unittests_resource.h',
121             'installer/util/language_selector_unittest.cc',
122             'installer/util/logging_installer_unittest.cc',
123             'installer/util/lzma_util_unittest.cc',
124             'installer/util/master_preferences_unittest.cc',
125             'installer/util/move_tree_work_item_unittest.cc',
126             'installer/util/product_state_unittest.cc',
127             'installer/util/product_unittest.cc',
128             'installer/util/product_unittest.h',
129             'installer/util/registry_key_backup_unittest.cc',
130             'installer/util/registry_test_data.cc',
131             'installer/util/registry_test_data.h',
132             'installer/util/run_all_unittests.cc',
133             'installer/util/self_cleaning_temp_dir_unittest.cc',
134             'installer/util/set_reg_value_work_item_unittest.cc',
135             'installer/util/shell_util_unittest.cc',
136             'installer/util/uninstall_metrics_unittest.cc',
137             'installer/util/wmi_unittest.cc',
138             'installer/util/work_item_list_unittest.cc',
139             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc',
140           ],
141           'msvs_settings': {
142             'VCManifestTool': {
143               'AdditionalManifestFiles': [
144                 '$(ProjectDir)\\installer\\mini_installer\\mini_installer.exe.manifest',
145               ],
146             },
147           },
148           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
149           'msvs_disabled_warnings': [ 4267, ],
150         },
151         {
152           'target_name': 'installer_util_strings',
153           'type': 'none',
154           'rules': [
155             {
156               'rule_name': 'installer_util_strings',
157               'extension': 'grd',
158               'variables': {
159                 'create_string_rc_py' : 'installer/util/prebuild/create_string_rc.py',
160               },
161               'inputs': [
162                 '<(create_string_rc_py)',
163                 '<(RULE_INPUT_PATH)',
164               ],
165               'outputs': [
166                 # Don't use <(RULE_INPUT_ROOT) to create the output file
167                 # name, because the base name of the input
168                 # (generated_resources.grd) doesn't match the generated file
169                 # (installer_util_strings.h).
170                 '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.h',
171                 '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc',
172               ],
173               'action': ['python',
174                          '<(create_string_rc_py)',
175                          '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings',
176                          '<(branding)',],
177               'message': 'Generating resources from <(RULE_INPUT_PATH)',
178               'msvs_cygwin_shell': 1,
179             },
180           ],
181           'sources': [
182             'app/chromium_strings.grd',
183           ],
184           'direct_dependent_settings': {
185             'include_dirs': [
186               '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings',
187             ],
188           },
189         },
190         {
191           'target_name': 'launcher_support',
192           'type': 'static_library',
193           'include_dirs': [
194             '..',
195           ],
196           'direct_dependent_settings': {
197             'include_dirs': [
198               '..',
199             ],
200           },
201           'dependencies': [
202             '<(DEPTH)/base/base.gyp:base',
203           ],
204           'sources': [
205             'installer/launcher_support/chrome_launcher_support.cc',
206             'installer/launcher_support/chrome_launcher_support.h',
207           ],
208         },
209         {
210           'target_name': 'mini_installer_test',
211           'type': 'executable',
212           'dependencies': [
213             'installer_util',
214             'installer_util_strings',
215             '../base/base.gyp:base',
216             '../base/base.gyp:base_i18n',
217             '../base/base.gyp:test_support_base',
218             '../chrome/chrome.gyp:test_support_common',
219             '../testing/gtest.gyp:gtest',
220           ],
221           'include_dirs': [
222             '..',
223           ],
224           'sources': [
225             '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc',
226             'installer/util/installation_validation_helper.cc',
227             'installer/util/installation_validation_helper.h',
228             'test/mini_installer_test/installer_path_provider.cc',
229             'test/mini_installer_test/installer_path_provider.h',
230             'test/mini_installer_test/installer_test_util.cc',
231             'test/mini_installer_test/installer_test_util.h',
232             'test/mini_installer_test/mini_installer_test_constants.cc',
233             'test/mini_installer_test/mini_installer_test_constants.h',
234             'test/mini_installer_test/run_all_unittests.cc',
235             'test/mini_installer_test/switch_builder.cc',
236             'test/mini_installer_test/switch_builder.h',
237             'test/mini_installer_test/test.cc',
238           ],
239           'msvs_settings': {
240             'VCManifestTool': {
241               'AdditionalManifestFiles': [
242                 '$(ProjectDir)\\installer\\mini_installer\\mini_installer.exe.manifest',
243               ],
244             },
245           },
246         },
247         {
248           'target_name': 'setup',
249           'type': 'executable',
250           'dependencies': [
251             'installer_util',
252             'installer_util_strings',
253             'launcher_support',
254             '../base/base.gyp:base',
255             '../breakpad/breakpad.gyp:breakpad_handler',
256             '../chrome/common_constants.gyp:common_constants',
257             '../chrome_frame/chrome_frame.gyp:chrome_tab_idl',
258             '../chrome_frame/chrome_frame.gyp:npchrome_frame',
259             '../rlz/rlz.gyp:rlz_lib',
260             '../third_party/zlib/zlib.gyp:zlib',
261           ],
262           'include_dirs': [
263             '..',
264             '<(INTERMEDIATE_DIR)',
265             '<(SHARED_INTERMEDIATE_DIR)/setup',
266           ],
267           'direct_dependent_settings': {
268             'include_dirs': [
269               '<(SHARED_INTERMEDIATE_DIR)/setup',
270             ],
271           },
272           'sources': [
273             'installer/mini_installer/chrome.release',
274             'installer/setup/archive_patch_helper.cc',
275             'installer/setup/archive_patch_helper.h',
276             'installer/setup/cf_migration.cc',
277             'installer/setup/cf_migration.h',
278             'installer/setup/chrome_frame_quick_enable.cc',
279             'installer/setup/chrome_frame_quick_enable.h',
280             'installer/setup/chrome_frame_ready_mode.cc',
281             'installer/setup/chrome_frame_ready_mode.h',
282             'installer/setup/install.cc',
283             'installer/setup/install.h',
284             'installer/setup/install_worker.cc',
285             'installer/setup/install_worker.h',
286             'installer/setup/setup_main.cc',
287             'installer/setup/setup_main.h',
288             'installer/setup/setup.ico',
289             'installer/setup/setup.rc',
290             'installer/setup/setup_constants.cc',
291             'installer/setup/setup_constants.h',
292             'installer/setup/setup_exe_version.rc.version',
293             'installer/setup/setup_resource.h',
294             'installer/setup/setup_util.cc',
295             'installer/setup/setup_util.h',
296             'installer/setup/uninstall.cc',
297             'installer/setup/uninstall.h',
298           ],
299           'msvs_settings': {
300             'VCLinkerTool': {
301               'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
302             },
303             'VCManifestTool': {
304               'AdditionalManifestFiles': [
305                 '$(ProjectDir)\\installer\\setup\\setup.exe.manifest',
306               ],
307             },
308           },
309           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
310           'msvs_disabled_warnings': [ 4267, ],
311           'rules': [
312             {
313               'rule_name': 'setup_version',
314               'extension': 'version',
315               'variables': {
316                 'version_py_path': '../chrome/tools/build/version.py',
317                 'template_input_path': 'installer/setup/setup_exe_version.rc.version',
318               },
319               'inputs': [
320                 '<(template_input_path)',
321                 '<(version_path)',
322                 '<(lastchange_path)',
323                 '<(branding_dir)/BRANDING',
324               ],
325               'outputs': [
326                 '<(SHARED_INTERMEDIATE_DIR)/setup/setup_exe_version.rc',
327               ],
328               'action': [
329                 'python', '<(version_py_path)',
330                 '-f', '<(version_path)',
331                 '-f', '<(lastchange_path)',
332                 '-f', '<(branding_dir)/BRANDING',
333                 '<(template_input_path)',
334                 '<@(_outputs)',
335               ],
336               'process_outputs_as_sources': 1,
337               'message': 'Generating version information'
338             },
339             {
340               'rule_name': 'server_dlls',
341               'extension': 'release',
342               'variables': {
343                 'scan_server_dlls_py' : 'tools/build/win/scan_server_dlls.py',
344                 'template_file': 'installer/mini_installer/chrome.release',
345               },
346               'inputs': [
347                 '<(scan_server_dlls_py)',
348                 '<(template_file)'
349               ],
350               'outputs': [
351                 '<(INTERMEDIATE_DIR)/registered_dlls.h',
352               ],
353               'action': [
354                 'python',
355                 '<(scan_server_dlls_py)',
356                 '--output_dir=<(PRODUCT_DIR)',
357                 '--input_file=<(RULE_INPUT_PATH)',
358                 '--header_output_dir=<(INTERMEDIATE_DIR)',
359                 # TODO(sgk):  may just use environment variables
360                 #'--distribution=$(CHROMIUM_BUILD)',
361                 '--distribution=_google_chrome',
362               ],
363               'msvs_cygwin_shell': 1,
364             },
365           ],
366           'conditions': [
367             ['component == "shared_library"', {
368               'variables': {
369                 'win_use_external_manifest': 1,
370               },
371             }],
372             # TODO(mark):  <(branding_dir) should be defined by the
373             # global condition block at the bottom of the file, but
374             # this doesn't work due to the following issue:
375             #
376             #   http://code.google.com/p/gyp/issues/detail?id=22
377             #
378             # Remove this block once the above issue is fixed.
379             [ 'branding == "Chrome"', {
380               'variables': {
381                  'branding_dir': 'app/theme/google_chrome',
382                  'branding_dir_100': 'app/theme/default_100_percent/google_chrome',
383               },
384             }, { # else branding!="Chrome"
385               'variables': {
386                  'branding_dir': 'app/theme/chromium',
387                  'branding_dir_100': 'app/theme/default_100_percent/chromium',
388               },
389             }],
390             ['target_arch=="x64"', {
391               'dependencies!': [
392                 '../chrome_frame/chrome_frame.gyp:chrome_tab_idl',
393                 '../chrome_frame/chrome_frame.gyp:npchrome_frame',
394               ],
395               'defines': [
396                 'OMIT_CHROME_FRAME',
397               ],
398             }],
399           ],
400         },
401         {
402           'target_name': 'setup_unittests',
403           'type': 'executable',
404           'dependencies': [
405             'installer_util',
406             'installer_util_strings',
407             'launcher_support',
408             '../base/base.gyp:base',
409             '../base/base.gyp:base_i18n',
410             '../base/base.gyp:test_support_base',
411             '../chrome_frame/chrome_frame.gyp:chrome_tab_idl',
412             '../testing/gmock.gyp:gmock',
413             '../testing/gtest.gyp:gtest',
414           ],
415           'include_dirs': [
416             '..',
417             '<(INTERMEDIATE_DIR)',
418           ],
419           # TODO(robertshield): Move the items marked with "Move to lib"
420           # below into a separate lib and then link both setup.exe and
421           # setup_unittests.exe against that.
422           'sources': [
423             'installer/mini_installer/chrome.release',  # Move to lib
424             'installer/mini_installer/appid.h',
425             'installer/mini_installer/chrome_appid.cc',
426             'installer/mini_installer/configuration.cc',
427             'installer/mini_installer/configuration.h',
428             'installer/mini_installer/configuration_test.cc',
429             'installer/mini_installer/decompress.cc',
430             'installer/mini_installer/decompress.h',
431             'installer/mini_installer/decompress_test.cc',
432             'installer/mini_installer/mini_string.cc',
433             'installer/mini_installer/mini_string.h',
434             'installer/mini_installer/mini_string_test.cc',
435             'installer/setup/archive_patch_helper.cc',  # Move to lib
436             'installer/setup/archive_patch_helper.h',   # Move to lib
437             'installer/setup/archive_patch_helper_unittest.cc',
438             'installer/setup/install.cc',               # Move to lib
439             'installer/setup/install.h',                # Move to lib
440             'installer/setup/install_unittest.cc',
441             'installer/setup/install_worker.cc',        # Move to lib
442             'installer/setup/install_worker.h',         # Move to lib
443             'installer/setup/install_worker_unittest.cc',
444             'installer/setup/run_all_unittests.cc',
445             'installer/setup/setup_constants.cc',       # Move to lib
446             'installer/setup/setup_constants.h',        # Move to lib
447             'installer/setup/setup_unittests.rc',
448             'installer/setup/setup_unittests_resource.h',
449             'installer/setup/setup_util.cc',
450             'installer/setup/setup_util_unittest.cc',
451             'installer/setup/setup_util_unittest.h',
452           ],
453           'rules': [
454             {
455               'rule_name': 'server_dlls',               # Move to lib
456               'extension': 'release',
457               'variables': {
458                 'scan_server_dlls_py' : 'tools/build/win/scan_server_dlls.py',
459                 'template_file': 'installer/mini_installer/chrome.release',
460               },
461               'inputs': [
462                 '<(scan_server_dlls_py)',
463                 '<(template_file)'
464               ],
465               'outputs': [
466                 '<(INTERMEDIATE_DIR)/registered_dlls.h',
467               ],
468               'action': [
469                 'python',
470                 '<(scan_server_dlls_py)',
471                 '--output_dir=<(PRODUCT_DIR)',
472                 '--input_file=<(RULE_INPUT_PATH)',
473                 '--header_output_dir=<(INTERMEDIATE_DIR)',
474                 # TODO(sgk):  may just use environment variables
475                 #'--distribution=$(CHROMIUM_BUILD)',
476                 '--distribution=_google_chrome',
477               ],
478               'msvs_cygwin_shell': 1,
479             },
480           ],
481           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
482           'msvs_disabled_warnings': [ 4267, ],
483         },
484       ],
485     }],
486     ['OS=="win" and target_arch=="ia32"', {
487       'targets': [
488         {
489           'target_name': 'launcher_support64',
490           'type': 'static_library',
491           'include_dirs': [
492             '..',
493           ],
494           'direct_dependent_settings': {
495             'include_dirs': [
496               '..',
497             ],
498           },
499           'defines': [
500               '<@(nacl_win64_defines)',
501           ],
502               'dependencies': [
503               '<(DEPTH)/base/base.gyp:base_nacl_win64',
504           ],
505           'configurations': {
506             'Common_Base': {
507               'msvs_target_platform': 'x64',
508             },
509           },
510           'sources': [
511             'installer/launcher_support/chrome_launcher_support.cc',
512             'installer/launcher_support/chrome_launcher_support.h',
513           ],
514         },
515       ],
516     }],
517     ['OS=="linux" and branding=="Chrome"', {
518       'variables': {
519         # Always google_chrome since this only applies to branding==Chrome.
520         'branding_dir': 'app/theme/google_chrome',
521         'branding_dir_100': 'app/theme/default_100_percent/google_chrome',
522         'version' : '<!(python <(version_py_path) -f ../chrome/VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
523         'revision' : '<!(python ../build/util/lastchange.py --revision-only)',
524         'packaging_files_common': [
525           'installer/linux/common/apt.include',
526           'installer/linux/common/default-app.template',
527           'installer/linux/common/default-app-block.template',
528           'installer/linux/common/desktop.template',
529           'installer/linux/common/google-chrome/google-chrome.info',
530           'installer/linux/common/installer.include',
531           'installer/linux/common/postinst.include',
532           'installer/linux/common/prerm.include',
533           'installer/linux/common/repo.cron',
534           'installer/linux/common/rpm.include',
535           'installer/linux/common/rpmrepo.cron',
536           'installer/linux/common/symlinks.include',
537           'installer/linux/common/variables.include',
538           'installer/linux/common/wrapper',
539         ],
540         'packaging_files_deb': [
541           'installer/linux/debian/build.sh',
542           'installer/linux/debian/changelog.template',
543           'installer/linux/debian/control.template',
544           'installer/linux/debian/debian.menu',
545           'installer/linux/debian/expected_deps',
546           'installer/linux/debian/postinst',
547           'installer/linux/debian/postrm',
548           'installer/linux/debian/prerm',
549         ],
550         'packaging_files_rpm': [
551           'installer/linux/rpm/build.sh',
552           'installer/linux/rpm/chrome.spec.template',
553           'installer/linux/rpm/expected_deps_i386',
554           'installer/linux/rpm/expected_deps_x86_64',
555         ],
556         'packaging_files_binaries': [
557           # TODO(mmoss) Any convenient way to get all the relevant build
558           # files? (e.g. all locales, resources, etc.)
559           '<(PRODUCT_DIR)/chrome',
560           '<(PRODUCT_DIR)/chrome_sandbox',
561           '<(PRODUCT_DIR)/libffmpegsumo.so',
562           '<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
563           '<(PRODUCT_DIR)/xdg-mime',
564           '<(PRODUCT_DIR)/xdg-settings',
565           '<(PRODUCT_DIR)/locales/en-US.pak',
566           '<(PRODUCT_DIR)/nacl_helper',
567           '<(PRODUCT_DIR)/nacl_helper_bootstrap',
568           '<(PRODUCT_DIR)/PepperFlash/libpepflashplayer.so',
569           '<(PRODUCT_DIR)/PepperFlash/manifest.json',
570           '<@(default_apps_list_linux_dest)',
571         ],
572         'flock_bash': ['flock', '--', '/tmp/linux_package_lock', 'bash'],
573         'deb_build': '<(PRODUCT_DIR)/installer/debian/build.sh',
574         'rpm_build': '<(PRODUCT_DIR)/installer/rpm/build.sh',
575         'deb_cmd': ['<@(flock_bash)', '<(deb_build)', '-o' '<(PRODUCT_DIR)',
576                     '-b', '<(PRODUCT_DIR)', '-a', '<(target_arch)'],
577         'rpm_cmd': ['<@(flock_bash)', '<(rpm_build)', '-o' '<(PRODUCT_DIR)',
578                     '-b', '<(PRODUCT_DIR)', '-a', '<(target_arch)'],
579         'conditions': [
580           ['target_arch=="ia32"', {
581             'deb_arch': 'i386',
582             'rpm_arch': 'i386',
583             'packaging_files_binaries': [
584               '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
585               '<(PRODUCT_DIR)/libwidevinecdmadapter.so',
586               '<(PRODUCT_DIR)/libwidevinecdm.so',
587             ],
588           }],
589           ['target_arch=="x64"', {
590             'deb_arch': 'amd64',
591             'rpm_arch': 'x86_64',
592             'packaging_files_binaries': [
593               '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
594               '<(PRODUCT_DIR)/libwidevinecdmadapter.so',
595               '<(PRODUCT_DIR)/libwidevinecdm.so',
596             ],
597           }],
598           ['target_arch=="arm"', {
599             'deb_arch': 'arm',
600             'rpm_arch': 'arm',
601           }],
602           ['internal_pdf', {
603             'packaging_files_binaries': [
604               '<(PRODUCT_DIR)/libpdf.so',
605             ],
606           }],
607           ['libpeer_target_type!="static_library"', {
608             'packaging_files_binaries': [
609               '<(PRODUCT_DIR)/lib/libpeerconnection.so',
610             ],
611           }],
612         ],
613       },
614       'targets': [
615         {
616           'target_name': 'linux_installer_configs',
617           'type': 'none',
618           # Add these files to the build output so the build archives will be
619           # "hermetic" for packaging. This is only for branding="Chrome" since
620           # we only create packages for official builds.
621           'copies': [
622             {
623               'destination': '<(PRODUCT_DIR)/installer/debian/',
624               'files': [
625                 '<@(packaging_files_deb)',
626               ]
627             },
628             {
629               'destination': '<(PRODUCT_DIR)/installer/rpm/',
630               'files': [
631                 '<@(packaging_files_rpm)',
632               ]
633             },
634             {
635               'destination': '<(PRODUCT_DIR)/installer/common/',
636               'files': [
637                 '<@(packaging_files_common)',
638               ]
639             },
640             # Additional theme resources needed for package building.
641             {
642               'destination': '<(PRODUCT_DIR)/installer/theme/',
643               'files': [
644                 '<(branding_dir_100)/product_logo_16.png',
645                 '<(branding_dir)/product_logo_22.png',
646                 '<(branding_dir)/product_logo_24.png',
647                 '<(branding_dir_100)/product_logo_32.png',
648                 '<(branding_dir)/product_logo_48.png',
649                 '<(branding_dir)/product_logo_64.png',
650                 '<(branding_dir)/product_logo_128.png',
651                 '<(branding_dir)/product_logo_256.png',
652                 '<(branding_dir)/product_logo_32.xpm',
653                 '<(branding_dir)/BRANDING',
654               ],
655             },
656           ],
657           'actions': [
658             {
659               'action_name': 'save_build_info',
660               'inputs': [
661                 '<(branding_dir)/BRANDING',
662                 '<(version_path)',
663                 '<(lastchange_path)',
664               ],
665               'outputs': [
666                 '<(PRODUCT_DIR)/installer/version.txt',
667               ],
668               # Just output the default version info variables.
669               'action': [
670                 'python', '<(version_py_path)',
671                 '-f', '<(branding_dir)/BRANDING',
672                 '-f', '<(version_path)',
673                 '-f', '<(lastchange_path)',
674                 '-o', '<@(_outputs)'
675               ],
676             },
677           ],
678         },
679         {
680           'target_name': 'linux_packages_all',
681           'suppress_wildcard': 1,
682           'type': 'none',
683           'dependencies': [
684             'linux_packages_unstable',
685             'linux_packages_beta',
686             'linux_packages_stable',
687           ],
688         },
689         {
690           # 'asan' is a developer, testing-only package, so it shouldn't be
691           # included in the 'linux_packages_all' collection.
692           'target_name': 'linux_packages_asan',
693           'suppress_wildcard': 1,
694           'type': 'none',
695           'dependencies': [
696             'linux_packages_asan_deb',
697           ],
698           # ChromeOS doesn't care about RPM packages.
699           'conditions': [
700             ['chromeos==0', {
701               'dependencies': [
702                 'linux_packages_asan_rpm',
703               ],
704             }],
705           ],
706         },
707         {
708           # 'trunk' is a developer, testing-only package, so it shouldn't be
709           # included in the 'linux_packages_all' collection.
710           'target_name': 'linux_packages_trunk',
711           'suppress_wildcard': 1,
712           'type': 'none',
713           'dependencies': [
714             'linux_packages_trunk_deb',
715           ],
716           # ChromeOS doesn't care about RPM packages.
717           'conditions': [
718             ['chromeos==0', {
719               'dependencies': [
720                 'linux_packages_trunk_rpm',
721               ],
722             }],
723           ],
724         },
725         {
726           'target_name': 'linux_packages_unstable',
727           'suppress_wildcard': 1,
728           'type': 'none',
729           'dependencies': [
730             'linux_packages_unstable_deb',
731           ],
732           # ChromeOS doesn't care about RPM packages.
733           'conditions': [
734             ['chromeos==0', {
735               'dependencies': [
736                 'linux_packages_unstable_rpm',
737               ],
738             }],
739           ],
740         },
741         {
742           'target_name': 'linux_packages_beta',
743           'suppress_wildcard': 1,
744           'type': 'none',
745           'dependencies': [
746             'linux_packages_beta_deb',
747           ],
748           # ChromeOS doesn't care about RPM packages.
749           'conditions': [
750             ['chromeos==0', {
751               'dependencies': [
752                 'linux_packages_beta_rpm',
753               ],
754             }],
755           ],
756         },
757         {
758           'target_name': 'linux_packages_stable',
759           'suppress_wildcard': 1,
760           'type': 'none',
761           'dependencies': [
762             'linux_packages_stable_deb',
763           ],
764           # ChromeOS doesn't care about RPM packages.
765           'conditions': [
766             ['chromeos==0', {
767               'dependencies': [
768                 'linux_packages_stable_rpm',
769               ],
770             }],
771           ],
772         },
773         # TODO(mmoss) gyp looping construct would be handy here ...
774         # These package actions are the same except for the 'channel' variable.
775         {
776           'target_name': 'linux_packages_asan_deb',
777           'suppress_wildcard': 1,
778           'type': 'none',
779           'dependencies': [
780             'chrome',
781             'linux_installer_configs',
782           ],
783           'actions': [
784             {
785               'variables': {
786                 'channel': 'asan',
787               },
788               'action_name': 'deb_packages_<(channel)',
789               'process_outputs_as_sources': 1,
790               'inputs': [
791                 '<(deb_build)',
792                 '<@(packaging_files_binaries)',
793                 '<@(packaging_files_common)',
794                 '<@(packaging_files_deb)',
795               ],
796               'outputs': [
797                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
798               ],
799               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
800             },
801           ],
802         },
803         {
804           'target_name': 'linux_packages_trunk_deb',
805           'suppress_wildcard': 1,
806           'type': 'none',
807           'dependencies': [
808             'chrome',
809             'linux_installer_configs',
810           ],
811           'actions': [
812             {
813               'variables': {
814                 'channel': 'trunk',
815               },
816               'action_name': 'deb_packages_<(channel)',
817               'process_outputs_as_sources': 1,
818               'inputs': [
819                 '<(deb_build)',
820                 '<@(packaging_files_binaries)',
821                 '<@(packaging_files_common)',
822                 '<@(packaging_files_deb)',
823               ],
824               'outputs': [
825                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
826               ],
827               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
828             },
829           ],
830         },
831         {
832           'target_name': 'linux_packages_unstable_deb',
833           'suppress_wildcard': 1,
834           'type': 'none',
835           'dependencies': [
836             'chrome',
837             'linux_installer_configs',
838           ],
839           'actions': [
840             {
841               'variables': {
842                 'channel': 'unstable',
843               },
844               'action_name': 'deb_packages_<(channel)',
845               'process_outputs_as_sources': 1,
846               'inputs': [
847                 '<(deb_build)',
848                 '<@(packaging_files_binaries)',
849                 '<@(packaging_files_common)',
850                 '<@(packaging_files_deb)',
851               ],
852               'outputs': [
853                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
854               ],
855               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
856             },
857           ],
858         },
859         {
860           'target_name': 'linux_packages_beta_deb',
861           'suppress_wildcard': 1,
862           'type': 'none',
863           'dependencies': [
864             'chrome',
865             'linux_installer_configs',
866           ],
867           'actions': [
868             {
869               'variables': {
870                 'channel': 'beta',
871               },
872               'action_name': 'deb_packages_<(channel)',
873               'process_outputs_as_sources': 1,
874               'inputs': [
875                 '<(deb_build)',
876                 '<@(packaging_files_binaries)',
877                 '<@(packaging_files_common)',
878                 '<@(packaging_files_deb)',
879               ],
880               'outputs': [
881                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
882               ],
883               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
884             },
885           ],
886         },
887         {
888           'target_name': 'linux_packages_stable_deb',
889           'suppress_wildcard': 1,
890           'type': 'none',
891           'dependencies': [
892             'chrome',
893             'linux_installer_configs',
894           ],
895           'actions': [
896             {
897               'variables': {
898                 'channel': 'stable',
899               },
900               'action_name': 'deb_packages_<(channel)',
901               'process_outputs_as_sources': 1,
902               'inputs': [
903                 '<(deb_build)',
904                 '<@(packaging_files_binaries)',
905                 '<@(packaging_files_common)',
906                 '<@(packaging_files_deb)',
907               ],
908               'outputs': [
909                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
910               ],
911               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
912             },
913           ],
914         },
915         {
916           'target_name': 'linux_packages_asan_rpm',
917           'suppress_wildcard': 1,
918           'type': 'none',
919           'dependencies': [
920             'chrome',
921             'linux_installer_configs',
922           ],
923           'actions': [
924             {
925               'variables': {
926                 'channel': 'asan',
927               },
928               'action_name': 'rpm_packages_<(channel)',
929               'process_outputs_as_sources': 1,
930               'inputs': [
931                 '<(rpm_build)',
932                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
933                 '<@(packaging_files_binaries)',
934                 '<@(packaging_files_common)',
935                 '<@(packaging_files_rpm)',
936               ],
937               'outputs': [
938                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
939               ],
940               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
941             },
942           ],
943         },
944         {
945           'target_name': 'linux_packages_trunk_rpm',
946           'suppress_wildcard': 1,
947           'type': 'none',
948           'dependencies': [
949             'chrome',
950             'linux_installer_configs',
951           ],
952           'actions': [
953             {
954               'variables': {
955                 'channel': 'trunk',
956               },
957               'action_name': 'rpm_packages_<(channel)',
958               'process_outputs_as_sources': 1,
959               'inputs': [
960                 '<(rpm_build)',
961                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
962                 '<@(packaging_files_binaries)',
963                 '<@(packaging_files_common)',
964                 '<@(packaging_files_rpm)',
965               ],
966               'outputs': [
967                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
968               ],
969               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
970             },
971           ],
972         },
973         {
974           'target_name': 'linux_packages_unstable_rpm',
975           'suppress_wildcard': 1,
976           'type': 'none',
977           'dependencies': [
978             'chrome',
979             'linux_installer_configs',
980           ],
981           'actions': [
982             {
983               'variables': {
984                 'channel': 'unstable',
985               },
986               'action_name': 'rpm_packages_<(channel)',
987               'process_outputs_as_sources': 1,
988               'inputs': [
989                 '<(rpm_build)',
990                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
991                 '<@(packaging_files_binaries)',
992                 '<@(packaging_files_common)',
993                 '<@(packaging_files_rpm)',
994               ],
995               'outputs': [
996                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
997               ],
998               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
999             },
1000           ],
1001         },
1002         {
1003           'target_name': 'linux_packages_beta_rpm',
1004           'suppress_wildcard': 1,
1005           'type': 'none',
1006           'dependencies': [
1007             'chrome',
1008             'linux_installer_configs',
1009           ],
1010           'actions': [
1011             {
1012               'variables': {
1013                 'channel': 'beta',
1014               },
1015               'action_name': 'rpm_packages_<(channel)',
1016               'process_outputs_as_sources': 1,
1017               'inputs': [
1018                 '<(rpm_build)',
1019                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
1020                 '<@(packaging_files_binaries)',
1021                 '<@(packaging_files_common)',
1022                 '<@(packaging_files_rpm)',
1023               ],
1024               'outputs': [
1025                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
1026               ],
1027               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
1028             },
1029           ],
1030         },
1031         {
1032           'target_name': 'linux_packages_stable_rpm',
1033           'suppress_wildcard': 1,
1034           'type': 'none',
1035           'dependencies': [
1036             'chrome',
1037             'linux_installer_configs',
1038           ],
1039           'actions': [
1040             {
1041               'variables': {
1042                 'channel': 'stable',
1043               },
1044               'action_name': 'rpm_packages_<(channel)',
1045               'process_outputs_as_sources': 1,
1046               'inputs': [
1047                 '<(rpm_build)',
1048                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
1049                 '<@(packaging_files_binaries)',
1050                 '<@(packaging_files_common)',
1051                 '<@(packaging_files_rpm)',
1052               ],
1053               'outputs': [
1054                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
1055               ],
1056               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
1057             },
1058           ],
1059         },
1060       ],
1061     }],
1062     ['OS=="mac"', {
1063       'variables': {
1064         'mac_packaging_dir':
1065             '<(PRODUCT_DIR)/<(mac_product_name) Packaging',
1066         # <(PRODUCT_DIR) expands to $(BUILT_PRODUCTS_DIR), which doesn't
1067         # work properly in a shell script, where ${BUILT_PRODUCTS_DIR} is
1068         # needed.
1069         'mac_packaging_sh_dir':
1070             '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Packaging',
1071       }, # variables
1072       'targets': [
1073         {
1074           'target_name': 'installer_packaging',
1075           'type': 'none',
1076           'dependencies': [
1077             'installer/mac/third_party/bsdiff/goobsdiff.gyp:*',
1078             'installer/mac/third_party/xz/xz.gyp:*',
1079           ],
1080           'conditions': [
1081             ['buildtype=="Official"', {
1082               'actions': [
1083                 {
1084                   # Create sign.sh, the script that the packaging system will
1085                   # use to sign the .app bundle.
1086                   'action_name': 'Make sign.sh',
1087                   'variables': {
1088                     'make_signers_sh_path': 'installer/mac/make_signers.sh',
1089                   },
1090                   'inputs': [
1091                     '<(make_signers_sh_path)',
1092                     'installer/mac/sign_app.sh.in',
1093                     'installer/mac/sign_versioned_dir.sh.in',
1094                     'installer/mac/app_resource_rules.plist.in',
1095                     '<(version_path)',
1096                   ],
1097                   'outputs': [
1098                     '<(mac_packaging_dir)/sign_app.sh',
1099                     '<(mac_packaging_dir)/sign_versioned_dir.sh',
1100                     '<(mac_packaging_dir)/app_resource_rules.plist',
1101                   ],
1102                   'action': [
1103                     '<(make_signers_sh_path)',
1104                     '<(mac_packaging_sh_dir)',
1105                     '<(mac_product_name)',
1106                     '<(version_full)',
1107                   ],
1108                 },
1109               ],  # actions
1110             }],  # buildtype=="Official"
1111             ['branding=="Chrome" and buildtype=="Official"', {
1112               'actions': [
1113                 {
1114                   # copy_keychain_reauthorize.sh explains why this isn't in a
1115                   # 'copies' block, but briefly: this is a prebuilt signed
1116                   # binary component that relies on a correct signature to
1117                   # function properly, and a normal 'copies' block sadly makes
1118                   # a trivial modification to the file such that its signature
1119                   # is no longer valid.
1120                   'action_name': 'Copy keychain_reauthorize',
1121                   'variables': {
1122                     'keychain_reauthorize_path': 'tools/build/mac/copy_keychain_reauthorize.sh',
1123                     'keychain_reauthorize_normal_path': 'installer/mac/internal/keychain_reauthorize/com.google.Chrome',
1124                     'keychain_reauthorize_canary_path': 'installer/mac/internal/keychain_reauthorize/com.google.Chrome.canary',
1125                     'keychain_reauthorize_output_dir': '<(mac_packaging_dir)/.keychain_reauthorize',
1126                   },
1127                   'inputs': [
1128                     '<(keychain_reauthorize_path)',
1129                     '<(keychain_reauthorize_normal_path)',
1130                     '<(keychain_reauthorize_canary_path)',
1131                   ],
1132                   'outputs': [
1133                     '<(keychain_reauthorize_output_dir)/com.google.Chrome',
1134                     '<(keychain_reauthorize_output_dir)/com.google.Chrome.canary',
1135                   ],
1136                   'action': [
1137                     '<(keychain_reauthorize_path)',
1138                     '<(keychain_reauthorize_output_dir)',
1139                     '<(keychain_reauthorize_normal_path)',
1140                     '<(keychain_reauthorize_canary_path)',
1141                   ],
1142                 },
1143               ],  # actions
1144             }],  # branding=="Chrome" and buildtype=="Official"
1145           ],  # conditions
1146           'copies': [
1147             {
1148               # Put the files where the packaging system will find them. The
1149               # packager will use these when building the "full installer"
1150               # disk images and delta/differential update disk images.
1151               'destination': '<(mac_packaging_dir)',
1152               'files': [
1153                 '<(PRODUCT_DIR)/goobsdiff',
1154                 '<(PRODUCT_DIR)/goobspatch',
1155                 '<(PRODUCT_DIR)/liblzma_decompress.dylib',
1156                 '<(PRODUCT_DIR)/xz',
1157                 '<(PRODUCT_DIR)/xzdec',
1158                 'installer/mac/dirdiffer.sh',
1159                 'installer/mac/dirpatcher.sh',
1160                 'installer/mac/dmgdiffer.sh',
1161                 'installer/mac/pkg-dmg',
1162               ],
1163               'conditions': [
1164                 ['mac_keystone==1', {
1165                   'files': [
1166                     'installer/mac/keystone_install.sh',
1167                   ],
1168                 }],  # mac_keystone
1169                 ['branding=="Chrome" and buildtype=="Official"', {
1170                   'files': [
1171                     'app/theme/google_chrome/app_canary.icns',
1172                     'app/theme/google_chrome/document_canary.icns',
1173                     'installer/mac/internal/chrome_canary_dmg_dsstore',
1174                     'installer/mac/internal/chrome_canary_dmg_icon.icns',
1175                     'installer/mac/internal/chrome_dmg_background.png',
1176                     'installer/mac/internal/chrome_dmg_dsstore',
1177                     'installer/mac/internal/chrome_dmg_icon.icns',
1178                     'installer/mac/internal/generate_dmgs',
1179                   ],
1180                 }],  # branding=="Chrome" and buildtype=="Official"
1181               ],  # conditions
1182             },
1183           ],  # copies
1184         },  # target: installer_packaging
1185         {
1186           'target_name': 'gcapi_lib',
1187           'type': 'static_library',
1188           'include_dirs': [
1189             '..',
1190           ],
1191           'sources': [
1192             'installer/gcapi_mac/gcapi.h',
1193             'installer/gcapi_mac/gcapi.mm',
1194           ],
1195           'link_settings': {
1196             'libraries': [
1197               '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
1198             ],
1199           },
1200           'xcode_settings': {
1201             'ARCHS': [ 'i386', 'x86_64' ],
1202             'MACOSX_DEPLOYMENT_TARGET': '10.4',
1203             'GCC_ENABLE_OBJC_GC': 'supported',
1204           },
1205         },
1206         {
1207           'target_name': 'gcapi_example',
1208           'type': 'executable',
1209           'dependencies': [
1210             'gcapi_lib',
1211           ],
1212           'include_dirs': [
1213             '..',
1214           ],
1215           'sources': [
1216             'installer/gcapi_mac/gcapi_example_client.mm',
1217           ],
1218         },
1219       ],  # targets
1220     }],  # OS=="mac"
1221     [ 'branding == "Chrome"', {
1222       'variables': {
1223          'branding_dir': 'app/theme/google_chrome',
1224          'branding_dir_100': 'app/theme/default_100_percent/google_chrome',
1225       },
1226     }, { # else branding!="Chrome"
1227       'variables': {
1228          'branding_dir': 'app/theme/chromium',
1229          'branding_dir_100': 'app/theme/default_100_percent/chromium',
1230       },
1231     }],
1232   ],