Cleanup: Pass a couple std::maps by const-ref in RenderFrameHostImpl.
[chromium-blink-merge.git] / chrome / version.gni
blobb2e38d5ada1c7125dda61fe6f669f870db45c4be
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,
11 # Parameters:
12 #   source:
13 #     File name of source template file to read.
15 #   output:
16 #     File name of file to write.
18 #   extra_args (optional):
19 #     Extra arguments to pass to version.py.
21 #   visibility (optional)
23 # Example:
24 #   process_version("myversion") {
25 #     source = "myfile.h.in"
26 #     output = "$target_gen_dir/myfile.h"
27 #     extra_args = ["-e", "FOO=42"]
28 #   }
29 template("process_version") {
30   assert(defined(invoker.source), "Source must be defined for $target_name")
31   assert(defined(invoker.output), "Output must be defined for $target_name")
33   action(target_name) {
34     if (defined(invoker.visibility)) {
35       visibility = invoker.visibility
36     }
37     script = "//build/util/version.py"
39     lastchange_path = "//build/util/LASTCHANGE"
40     version_path = "//chrome/VERSION"
41     if (is_chrome_branded) {
42       branding_path = "//chrome/app/theme/google_chrome/BRANDING"
43     } else {
44       branding_path = "//chrome/app/theme/chromium/BRANDING"
45     }
47     inputs = [
48       version_path,
49       invoker.source,
50       lastchange_path,
51       branding_path,
52     ]
54     outputs = [ invoker.output ]
56     args = [
57       "-f", rebase_path(version_path, root_build_dir),
58       "-f", rebase_path(branding_path, root_build_dir),
59       "-f", rebase_path(lastchange_path, root_build_dir),
60       "-i", rebase_path(invoker.source, root_build_dir),
61       "-o", rebase_path(invoker.output, root_build_dir),
62     ]
64     if (defined(invoker.extra_args)) {
65       args += invoker.extra_args
66     }
67   }