diff options
author | brettw <brettw@chromium.org> | 2015-07-21 21:26:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-22 04:27:41 +0000 |
commit | 983c0562bba1e4d93bb7ee489f56bcbd61fc55f9 (patch) | |
tree | 34dc4d88c58d0ff04997f39850fe7062ce0c09b9 /build/util | |
parent | 0355eead6c2048131771feb493187f6f80155cf6 (diff) | |
download | chromium_src-983c0562bba1e4d93bb7ee489f56bcbd61fc55f9.zip chromium_src-983c0562bba1e4d93bb7ee489f56bcbd61fc55f9.tar.gz chromium_src-983c0562bba1e4d93bb7ee489f56bcbd61fc55f9.tar.bz2 |
Hook up chrome.exe manifest in the Windows GN build.
This generates a proper version manifest for chrome.exe and also for the version assembly.
This adds a new way to get the chrome version info programatically at GN time. Although this adds another exec_script call, it removes four such calls in remoting so there is a net speed increase.
BUG=
Review URL: https://codereview.chromium.org/1250853007
Cr-Commit-Position: refs/heads/master@{#339833}
Diffstat (limited to 'build/util')
-rw-r--r-- | build/util/version.gni | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/build/util/version.gni b/build/util/version.gni new file mode 100644 index 0000000..d1bf6ef --- /dev/null +++ b/build/util/version.gni @@ -0,0 +1,42 @@ +# Copyright 2015 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. + +# This exposes the Chrome version as GN variables for use in build files. +# +# PREFER NOT TO USE THESE. The GYP build uses this kind of thing extensively. +# However, it is far better to write an action (or use the process_version +# wrapper in chrome/version.gni) to generate a file at build-time with the +# information you need. This allows better dependency checking and GN will +# run faster. +# +# These values should only be used if you REALLY need to depend on them at +# build-time, for example, in the computation of output file names. + +# Give version.py a pattern that will expand to a GN scope consisting of +# all values we need at once. +_version_dictionary_template = "full = \"@MAJOR@.@MINOR@.@BUILD@.@PATCH@\" " + + "major = \"@MAJOR@\" minor = \"@MINOR@\" " + + "build = \"@BUILD@\" patch = \"@PATCH@\"" + +# The file containing the Chrome version number. +chrome_version_file = "//chrome/VERSION" + +_result = exec_script("version.py", + [ + "-f", + rebase_path(chrome_version_file, root_build_dir), + "-t", + _version_dictionary_template, + ], + "scope", + [ chrome_version_file ]) + +# Full version. For example "45.0.12321.0" +chrome_version_full = _result.full + +# The consituent parts of the full version. +chrome_version_major = _result.major +chrome_version_minor = _result.minor +chrome_version_build = _result.build +chrome_version_patch = _result.patch |