• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2016 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# This exposes the Chrome branding as GN variables for use in build files.
6#
7# PREFER NOT TO USE THESE. The GYP build uses this kind of thing extensively.
8# However, it is far better to write an action to generate a file at
9# build-time with the information you need. This allows better dependency
10# checking and GN will run faster.
11#
12# These values should only be used if you REALLY need to depend on them at
13# build-time, for example, in the computation of output file names.
14
15import("//build/config/chrome_build.gni")
16
17_branding_dictionary_template =
18    "full_name = \"@PRODUCT_FULLNAME@\" " +
19    "short_name = \"@PRODUCT_SHORTNAME@\" " +
20    "bundle_id = \"@MAC_BUNDLE_ID@\" " +
21    "creator_code = \"@MAC_CREATOR_CODE@\" " +
22    "installer_full_name = \"@PRODUCT_INSTALLER_FULLNAME@\" " +
23    "installer_short_name = \"@PRODUCT_INSTALLER_SHORTNAME@\" " +
24    "team_id = \"@MAC_TEAM_ID@\" "
25
26_result = exec_script("version.py",
27                      [
28                        "-f",
29                        rebase_path(branding_file_path, root_build_dir),
30                        "-t",
31                        _branding_dictionary_template,
32                      ],
33                      "scope",
34                      [ branding_file_path ])
35
36chrome_product_full_name = _result.full_name
37chrome_product_short_name = _result.short_name
38chrome_product_installer_full_name = _result.installer_full_name
39chrome_product_installer_short_name = _result.installer_short_name
40
41if (is_mac) {
42  chrome_mac_bundle_id = _result.bundle_id
43  chrome_mac_creator_code = _result.creator_code
44  chrome_mac_team_id = _result.team_id
45}
46