Kaido Kert | 5ac52c4 | 2021-05-14 12:23:37 -0700 | [diff] [blame] | 1 | # Copyright 2016 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. |
| 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 | |
| 15 | import("//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 | |
| 36 | chrome_product_full_name = _result.full_name |
| 37 | chrome_product_short_name = _result.short_name |
| 38 | chrome_product_installer_full_name = _result.installer_full_name |
| 39 | chrome_product_installer_short_name = _result.installer_short_name |
| 40 | |
| 41 | if (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 | } |