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 # TODO(brettw) Forking out to Python 4 times in serial just to get version
6 # numbers is highly undesirable. Instead, there should be a build step to
7 # generate an appropriate header so that the version can be generated at
8 # build-time, and not at GN-time.
10 # The |major|, |build| and |patch| versions are inherited from Chrome.
11 # Since Chrome's |minor| version is always '0', we replace it with a
12 # Chromoting-specific patch version.
13 # Note that we check both the |chrome_version_path| file and the
14 # |remoting_version_path| so that we can override the Chrome version
16 _version_py_abspath = "//build/util/version.py"
17 _remoting_version_abspath = "//remoting/VERSION"
18 _chrome_version_abspath = "//chrome/VERSION"
20 # Set these files as being input dependencies to the scripts, so the build will
21 # be re-run if the files change.
22 _script_deps = [ _remoting_version_abspath, _chrome_version_abspath ]
24 _chrome_version_path = rebase_path(_chrome_version_abspath, root_build_dir)
25 _remoting_version_path = rebase_path(_remoting_version_abspath, root_build_dir)
27 version_major = exec_script(
29 [ "-f", _chrome_version_path,
30 "-f", _remoting_version_path,
35 version_minor = exec_script(
37 [ "-f", _remoting_version_path,
38 "-t \"@REMOTING_PATCH@\"" ],
42 version_short = "${version_major}.${version_minor}." + exec_script(
44 [ "-f", _chrome_version_path,
45 "-f", _remoting_version_path,
50 version_full = "${version_short}." + exec_script(
52 [ "-f", _chrome_version_path,
53 "-f", _remoting_version_path,