remoting_version.gni 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.
  4. import("//build/config/chrome_build.gni")
  5. import("//chrome/version.gni")
  6. remoting_version_file = "//remoting/VERSION"
  7. _version_py_abspath = "//build/util/version.py"
  8. if (is_chrome_branded) {
  9. _remoting_branding_abspath = "//remoting/branding_Chrome"
  10. } else {
  11. _remoting_branding_abspath = "//remoting/branding_Chromium"
  12. }
  13. # Set these files as being input dependencies to the scripts, so the build will
  14. # be re-run if the files change.
  15. remoting_version_files = [
  16. remoting_version_file,
  17. _remoting_branding_abspath,
  18. ]
  19. _remoting_version_path = rebase_path(remoting_version_file, root_build_dir)
  20. _remoting_branding_path =
  21. rebase_path(_remoting_branding_abspath, root_build_dir)
  22. _template =
  23. "mac_native_messaging_bundle = \"@MAC_NATIVE_MESSAGING_HOST_BUNDLE_NAME@\" "
  24. _template += "mac_remote_assistance_bundle = \"@MAC_REMOTE_ASSISTANCE_HOST_BUNDLE_NAME@\" "
  25. _template += "host_bundle_name = \"@MAC_HOST_BUNDLE_NAME@\" "
  26. _template += "host_legacy_bundle_name = \"@MAC_HOST_LEGACY_BUNDLE_NAME@\" "
  27. _template += "host_name= \"@MAC_HOST_PACKAGE_NAME@\" "
  28. _template += "host_service_name = \"@DAEMON_FILE_NAME@\" "
  29. _template += "bundle_prefix = \"@MAC_UNINSTALLER_BUNDLE_PREFIX@\" "
  30. _template += "host_uninstaller_name = \"@MAC_UNINSTALLER_NAME@\" "
  31. _template += "version_patch = \"@REMOTING_PATCH@\" "
  32. if (is_mac) {
  33. _template += "host_bundle_id = \"@MAC_HOST_BUNDLE_ID@\" "
  34. _template += "native_messaging_host_bundle_id = \"@MAC_NATIVE_MESSAGING_HOST_BUNDLE_ID@\""
  35. _template += "remote_assistance_host_bundle_id = \"@MAC_REMOTE_ASSISTANCE_HOST_BUNDLE_ID@\" "
  36. _template += "uninstaller_bundle_id = \"@MAC_UNINSTALLER_BUNDLE_ID@\""
  37. }
  38. if (is_ios) {
  39. _template += "ios_bundle_id = \"@IOS_BUNDLE_ID@\""
  40. _template += "ios_display_name = \"@IOS_DISPLAY_NAME@\""
  41. _template += "ios_exec_name = \"@IOS_EXEC_NAME@\""
  42. _template += "ios_product_name = \"@IOS_PRODUCT_NAME@\""
  43. }
  44. _result = exec_script(_version_py_abspath,
  45. [
  46. "-f",
  47. _remoting_branding_path,
  48. "-f",
  49. _remoting_version_path,
  50. "-t",
  51. _template,
  52. ],
  53. "scope",
  54. remoting_version_files)
  55. host_name = _result.host_name
  56. host_service_name = _result.host_service_name
  57. bundle_prefix = _result.bundle_prefix
  58. host_uninstaller_name = _result.host_uninstaller_name
  59. me2me_host_bundle_name = _result.host_bundle_name
  60. me2me_host_legacy_bundle_name = _result.host_legacy_bundle_name
  61. native_messaging_host_bundle_name = _result.mac_native_messaging_bundle
  62. remote_assistance_host_bundle_name = _result.mac_remote_assistance_bundle
  63. remoting_version_patch = _result.version_patch
  64. remoting_version_short =
  65. "$chrome_version_major.$remoting_version_patch.$chrome_version_build"
  66. remoting_version_full = "$remoting_version_short.$chrome_version_patch"
  67. if (is_mac) {
  68. host_bundle_id = _result.host_bundle_id
  69. native_messaging_host_bundle_id = _result.native_messaging_host_bundle_id
  70. remote_assistance_host_bundle_id = _result.remote_assistance_host_bundle_id
  71. uninstaller_bundle_id = _result.uninstaller_bundle_id
  72. host_name_nospace = exec_script("//remoting/tools/remove_spaces.py",
  73. [ "$host_name" ],
  74. "trim string")
  75. host_service_name_nospace = exec_script("//remoting/tools/remove_spaces.py",
  76. [ "$host_service_name" ],
  77. "trim string")
  78. host_uninstaller_name_nospace =
  79. exec_script("//remoting/tools/remove_spaces.py",
  80. [ "$host_uninstaller_name" ],
  81. "trim string")
  82. }
  83. if (is_ios) {
  84. remoting_ios_bundle_id = _result.ios_bundle_id
  85. remoting_ios_display_name = _result.ios_display_name
  86. remoting_ios_executable_name = _result.ios_exec_name
  87. remoting_ios_product_name = _result.ios_product_name
  88. }