1 # Copyright 2014 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.
5 # Runs the version processing script over the given template file to produce
6 # an output file. This is used for generating various forms of files that
7 # incorporate the product name and version.
9 # This template automatically includes VERSION, LASTCHANGE, and BRANDING,
13 # File name of source template file to read.
16 # File name of file to write.
18 # visibility (optional)
21 # process_version("myversion") {
22 # source = "myfile.h.in"
23 # output = "$target_gen_dir/myfile.h"
25 template("process_version") {
26 assert(defined(invoker.source), "Source must be defined for $target_name")
27 assert(defined(invoker.output), "Output must be defined for $target_name")
30 if (defined(invoker.visibility)) {
31 visibility = invoker.visibility
33 script = "//build/util/version.py"
35 lastchange_path = "//build/util/LASTCHANGE"
36 version_path = "//chrome/VERSION"
37 if (is_chrome_branded) {
38 branding_path = "//chrome/app/theme/google_chrome/BRANDING"
40 branding_path = "//chrome/app/theme/chromium/BRANDING"
50 outputs = [ invoker.output ]
53 "-f", rebase_path(version_path, root_build_dir),
54 "-f", rebase_path(branding_path, root_build_dir),
55 "-f", rebase_path(lastchange_path, root_build_dir),
56 rebase_path(invoker.source, root_build_dir),
57 rebase_path(invoker.output, root_build_dir),