Revert of Added temporarily CHECKs to OmniboxNavigationObserver. (patchset #2 id...
[chromium-blink-merge.git] / chrome / version.gni
blobcc8d96a4c665d7f99bd2d8dc4f262dfe80a862b4
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 = [
55       invoker.output,
56     ]
58     args = [
59       "-f",
60       rebase_path(version_path, root_build_dir),
61       "-f",
62       rebase_path(branding_path, root_build_dir),
63       "-f",
64       rebase_path(lastchange_path, root_build_dir),
65       "-i",
66       rebase_path(invoker.source, root_build_dir),
67       "-o",
68       rebase_path(invoker.output, root_build_dir),
69     ]
71     if (defined(invoker.extra_args)) {
72       args += invoker.extra_args
73     }
74   }