OLD | NEW |
(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 # The path to the BRANDING file in chrome/app/theme. |
| 9 branding_file_path = "//chrome/app/theme/$branding_path_component/BRANDING" |
| 10 |
| 11 # This is a wrapper around process_version() that eases the task of processing |
| 12 # a .rc.version file (used especially on Windows). |
| 13 # |
| 14 # This template automatically includes VERSION, LASTCHANGE and BRANDING, and |
| 15 # any additional source files are passed after those (so their values can |
| 16 # override the ones specified by those 3 files). |
| 17 # |
| 18 # Parameters: |
| 19 # sources (optional): |
| 20 # List of files with value definitions that will be passed in addition to |
| 21 # VERSION, LASTCHANGE and BRANDING. |
| 22 # |
| 23 # template_file (optional): |
| 24 # Template file to use (not a list). If not specified, a default value, |
| 25 # //chrome/app/chrome_version.rc.version will be used. |
| 26 # |
| 27 # This template forwards all other parameters directly to process_version(). |
| 28 # |
| 29 # Examples: |
| 30 # process_version_rc_template("my_exe_version") { |
| 31 # output = "$target_gen_dir/my_exe_version.rc" |
| 32 # sources = [ "frob/my_exe.ver" ] |
| 33 # extra_args = [ "-e", "FOO=42" ] |
| 34 # } |
| 35 # |
| 36 # process_version_rc_template("my_dll_version") { |
| 37 # output = "$target_gen_dir/my_dll_version.rc" |
| 38 # template_file = [ "//foo/bar/my_dll_version.rc.version" ] |
| 39 # } |
| 40 template("process_version_rc_template") { |
| 41 if (defined(invoker.template_file)) { |
| 42 _template_file = invoker.template_file |
| 43 } else { |
| 44 _template_file = "//chrome/app/chrome_version.rc.version" |
| 45 } |
| 46 _sources = [ |
| 47 "//build/util/LASTCHANGE", |
| 48 "//chrome/VERSION", |
| 49 branding_file_path, |
| 50 ] |
| 51 if (defined(invoker.sources)) { |
| 52 _sources += invoker.sources |
| 53 } |
| 54 |
| 55 process_version(target_name) { |
| 56 template_file = _template_file |
| 57 sources = _sources |
| 58 forward_variables_from(invoker, |
| 59 "*", |
| 60 [ |
| 61 "sources", |
| 62 "template_file", |
| 63 ]) |
| 64 } |
| 65 } |
OLD | NEW |