blob: d81d85d3935c1d353d24936cd6e312af8ad09962 [file] [log] [blame]
sdefresne6e883e42015-07-30 08:05:541# Copyright 2015 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.
4
5{
6 'variables': {
joleksy0495daeb2015-10-21 14:37:047 'conditions': [
8 ['branding == "Chrome"', {
9 'use_unofficial_version_number%': 0,
10 }, {
11 'use_unofficial_version_number%': 1,
12 }],
13 ],
sdefresne6e883e42015-07-30 08:05:5414 },
15 'targets': [
16 {
17 # GN version: //components/version_info
18 'target_name': 'version_info',
19 'type': 'static_library',
20 'include_dirs': [
21 '..',
22 ],
23 'dependencies': [
24 '../base/base.gyp:base',
sdefresne6e883e42015-07-30 08:05:5425 'components_strings.gyp:components_strings',
26 'generate_version_info',
27 ],
28 'sources': [
29 'version_info/version_info.cc',
30 'version_info/version_info.h',
31 ],
joleksy0495daeb2015-10-21 14:37:0432 'conditions': [
33 ['use_unofficial_version_number==1', {
34 'dependencies': [
35 '../ui/base/ui_base.gyp:ui_base',
36 ],
37 'defines': ['USE_UNOFFICIAL_VERSION_NUMBER'],
38 }],
39 ],
sdefresne6e883e42015-07-30 08:05:5440 },
41 {
42 # GN version: //components/version_info:generate_version
43 'target_name': 'generate_version_info',
44 'type': 'none',
45 'direct_dependent_settings': {
46 'include_dirs': [
47 '<(SHARED_INTERMEDIATE_DIR)',
48 ],
49 },
50 # Because generate_version_info generates a header, the target must set
51 # the hard_dependency flag.
52 'hard_dependency': 1,
53 'actions': [
54 {
55 'action_name': 'generation_version_info',
56 'message': 'Generating version information',
57 'variables': {
58 'extra_version_flags': [],
59 'lastchange_path': '../build/util/LASTCHANGE',
60 'version_py_path': '../build/util/version.py',
61 'template_input_path': 'version_info/version_info_values.h.version',
62 # Use VERSION and BRANDING files from //chrome even if this is bad
63 # dependency until they are moved to src/ for VERSION and to the
64 # version_info component for BRANDING. Synchronisation with TPM and
65 # all release script is required for thoses moves. They are tracked
66 # by issues http://crbug.com/512347 and http://crbug.com/513603.
67 'version_path': '../chrome/VERSION',
68 'branding_path': '../chrome/app/theme/<(branding_path_component)/BRANDING',
69 },
70 'inputs': [
71 '<(version_py_path)',
72 '<(template_input_path)',
73 '<(version_path)',
74 '<(branding_path)',
75 '<(lastchange_path)',
76 ],
77 'outputs': [
78 '<(SHARED_INTERMEDIATE_DIR)/components/version_info/version_info_values.h',
79 ],
80 'action': [
81 'python',
82 '<(version_py_path)',
83 '-f', '<(version_path)',
84 '-f', '<(branding_path)',
85 '-f', '<(lastchange_path)',
86 '<@(extra_version_flags)',
87 '<(template_input_path)',
88 '<@(_outputs)',
89 ],
sdefresne6e883e42015-07-30 08:05:5490 },
91 ],
92 },
93 ],
sdefresne6e883e42015-07-30 08:05:5494}