diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-20 22:16:30 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-20 22:18:05 +0000 |
commit | 55699f3922240d6fb09ae7cda583687971111670 (patch) | |
tree | 2404618dc3620c64578d73b38c09e0c271f537a8 /chrome/version.gni | |
parent | 2d7c37bdeac0c991eab19ef5916438ba796946b5 (diff) | |
download | chromium_src-55699f3922240d6fb09ae7cda583687971111670.zip chromium_src-55699f3922240d6fb09ae7cda583687971111670.tar.gz chromium_src-55699f3922240d6fb09ae7cda583687971111670.tar.bz2 |
Add chrome, installer_util targets to GN build.
The chrome target doesn't link yet so is currently a source set.
This adds some installer util targets and some related targets, as well as fixes up some TODOs referencing completed targets.
Fixes and enables the snapshot unit test.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/489223002
Cr-Commit-Position: refs/heads/master@{#290927}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/version.gni')
-rw-r--r-- | chrome/version.gni | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/chrome/version.gni b/chrome/version.gni new file mode 100644 index 0000000..771ea28 --- /dev/null +++ b/chrome/version.gni @@ -0,0 +1,60 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Runs the version processing script over the given template file to produce +# an output file. This is used for generating various forms of files that +# incorporate the product name and version. +# +# This template automatically includes VERSION, LASTCHANGE, and BRANDING, +# +# Parameters: +# source: +# File name of source template file to read. +# +# output: +# File name of file to write. +# +# visibility (optional) +# +# Example: +# process_version("myversion") { +# source = "myfile.h.in" +# output = "$target_gen_dir/myfile.h" +# } +template("process_version") { + assert(defined(invoker.source), "Source must be defined for $target_name") + assert(defined(invoker.output), "Output must be defined for $target_name") + + action(target_name) { + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + script = "//build/util/version.py" + + lastchange_path = "//build/util/LASTCHANGE" + version_path = "//chrome/VERSION" + if (is_chrome_branded) { + branding_path = "//chrome/app/theme/google_chrome/BRANDING" + } else { + branding_path = "//chrome/app/theme/chromium/BRANDING" + } + + inputs = [ + version_path, + invoker.source, + lastchange_path, + branding_path, + ] + + outputs = [ invoker.output ] + + args = [ + "-f", rebase_path(version_path, root_build_dir), + "-f", rebase_path(branding_path, root_build_dir), + "-f", rebase_path(lastchange_path, root_build_dir), + rebase_path(invoker.source, root_build_dir), + rebase_path(invoker.output, root_build_dir), + ] + } +} |