branding.gni 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. # This exposes the Chrome branding as GN variables for use in build files.
  5. #
  6. # PREFER NOT TO USE THESE. The GYP build uses this kind of thing extensively.
  7. # However, it is far better to write an action to generate a file at
  8. # build-time with the information you need. This allows better dependency
  9. # checking and GN will run faster.
  10. #
  11. # These values should only be used if you REALLY need to depend on them at
  12. # build-time, for example, in the computation of output file names.
  13. import("//build/config/chrome_build.gni")
  14. _branding_dictionary_template =
  15. "full_name = \"@PRODUCT_FULLNAME@\" " +
  16. "short_name = \"@PRODUCT_SHORTNAME@\" " +
  17. "bundle_id = \"@MAC_BUNDLE_ID@\" " +
  18. "creator_code = \"@MAC_CREATOR_CODE@\" " +
  19. "installer_full_name = \"@PRODUCT_INSTALLER_FULLNAME@\" " +
  20. "installer_short_name = \"@PRODUCT_INSTALLER_SHORTNAME@\" " +
  21. "team_id = \"@MAC_TEAM_ID@\" "
  22. _result = exec_script("version.py",
  23. [
  24. "-f",
  25. rebase_path(branding_file_path, root_build_dir),
  26. "-t",
  27. _branding_dictionary_template,
  28. ],
  29. "scope",
  30. [ branding_file_path ])
  31. chrome_product_full_name = _result.full_name
  32. chrome_product_short_name = _result.short_name
  33. chrome_product_installer_full_name = _result.installer_full_name
  34. chrome_product_installer_short_name = _result.installer_short_name
  35. if (is_mac) {
  36. chrome_mac_bundle_id = _result.bundle_id
  37. chrome_mac_creator_code = _result.creator_code
  38. chrome_mac_team_id = _result.team_id
  39. }