summaryrefslogtreecommitdiffstats
path: root/chrome/version_resource_rules.gypi
blob: afd44e392f46f6088ed9b38ee99292bb835e32bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This file defines rules that allow you to generate version resources for
# Windows images.

# Include 'version.gypi' at the top of your GYP file to define
# the required variables:
#
#  'includes': [
#    '<(DEPTH)/build/util/version.gypi',
#  ],
#
# Then include this rule file in a productname_resources target:
#
#    {
#      'target_name': 'chrome_version_resources',
#      ...
#      'variables': {
#        'output_dir': 'product_version',
#        'branding_path': 'some/branding/file',
#        'template_input_path': 'some/product_version.rc.version',
#        'extra_variable_files_arguments': [ '-f', 'some/file/with/variables' ],
#        'extra_variable_files': [ 'some/file/with/variables' ], # NOTE: matches that above
#      },
#      'includes': [
#        '<(DEPTH)/chrome/version_resource_rules.gypi',
#      ],
#    }
#
{
  'rules': [
    {
      'rule_name': 'version',
      'extension': 'ver',
      'variables': {
        'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
	'extra_variable_files%': [],
        'extra_variable_files_arguments%': [],
      },
      'inputs': [
        '<(version_py_path)',
        '<(version_path)',
        '<(branding_path)',
        '<(lastchange_path)',
        '<@(extra_variable_files)',
        '<(template_input_path)',
      ],
      'outputs': [
        '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)/<(RULE_INPUT_ROOT)_version.rc',
      ],
      'action': [
        'python',
        '<(version_py_path)',
        '-f', '<(RULE_INPUT_PATH)',
        '-f', '<(version_path)',
        '-f', '<(branding_path)',
        '-f', '<(lastchange_path)',
        '<@(extra_variable_files_arguments)',
        '<(template_input_path)',
        '<@(_outputs)',
      ],
      'message': 'Generating version information in <@(_outputs)'
    },
  ],
}