Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: chrome/process_version_rc_template.gni

Issue 2308313003: gn: Generalize process_version() and move it to build/util (Closed)
Patch Set: Move process_version_rc_template() to chrome// Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 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 import("//build/config/chrome_build.gni")
6 import("//build/util/process_version.gni")
7
8 # This is a wrapper around process_version() that eases the task of processing
9 # a .rc.version file (used especially on Windows).
10 #
11 # This template automatically includes VERSION, LASTCHANGE and BRANDING, and
12 # any additional source files are passed after those (so their values can
13 # override the ones specified by those 3 files).
14 #
15 # Parameters:
16 # sources (optional):
17 # List of files with value definitions that will be passed in addition to
18 # VERSION, LASTCHANGE and BRANDING.
19 #
20 # template_file (optional):
21 # Template file to use (not a list). If not specified, a default value,
22 # //chrome/app/chrome_version.rc.version will be used.
23 #
24 # This template forwards all other parameters directly to process_version().
25 #
26 # Examples:
27 # process_version_rc_template("my_exe_version") {
28 # output = "$target_gen_dir/my_exe_version.rc"
29 # sources = [ "frob/my_exe.ver" ]
30 # extra_args = [ "-e", "FOO=42" ]
31 # }
32 #
33 # process_version_rc_template("my_dll_version") {
34 # output = "$target_gen_dir/my_dll_version.rc"
35 # template_file = [ "//foo/bar/my_dll_version.rc.version" ]
36 # }
37 template("process_version_rc_template") {
38 if (defined(invoker.template_file)) {
39 _template_file = invoker.template_file
40 } else {
41 _template_file = "//chrome/app/chrome_version.rc.version"
42 }
43 _sources = [
44 "//build/util/LASTCHANGE",
45 "//chrome/VERSION",
46 branding_file_path,
47 ]
48 if (defined(invoker.sources)) {
49 _sources += invoker.sources
50 }
51
52 process_version(target_name) {
53 template_file = _template_file
54 sources = _sources
55 forward_variables_from(invoker,
56 "*",
57 [
58 "sources",
59 "template_file",
60 ])
61 }
62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698