Avi Drissman | d6cdf9b | 2022-09-15 19:52:53 | [diff] [blame] | 1 | # Copyright 2014 The Chromium Authors |
Brett Wilson | 1c69399 | 2014-08-25 19:10:01 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
brettw | 2b2364b | 2015-05-01 22:36:23 | [diff] [blame] | 5 | import("//build/config/chrome_build.gni") |
Andrew Grieve | 19a00ca | 2022-07-29 19:01:48 | [diff] [blame] | 6 | import("//chrome/version.gni") |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 7 | |
| 8 | remoting_version_file = "//remoting/VERSION" |
brettw | 2b2364b | 2015-05-01 22:36:23 | [diff] [blame] | 9 | |
Brett Wilson | 1c69399 | 2014-08-25 19:10:01 | [diff] [blame] | 10 | _version_py_abspath = "//build/util/version.py" |
kelvinp | 98a75069 | 2014-11-12 21:31:43 | [diff] [blame] | 11 | if (is_chrome_branded) { |
| 12 | _remoting_branding_abspath = "//remoting/branding_Chrome" |
| 13 | } else { |
| 14 | _remoting_branding_abspath = "//remoting/branding_Chromium" |
| 15 | } |
Brett Wilson | 1c69399 | 2014-08-25 19:10:01 | [diff] [blame] | 16 | |
| 17 | # Set these files as being input dependencies to the scripts, so the build will |
| 18 | # be re-run if the files change. |
garykac | c1fd3a3 | 2015-05-16 00:21:05 | [diff] [blame] | 19 | remoting_version_files = [ |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 20 | remoting_version_file, |
kelvinp | 98a75069 | 2014-11-12 21:31:43 | [diff] [blame] | 21 | _remoting_branding_abspath, |
| 22 | ] |
Brett Wilson | 1c69399 | 2014-08-25 19:10:01 | [diff] [blame] | 23 | |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 24 | _remoting_version_path = rebase_path(remoting_version_file, root_build_dir) |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 25 | _remoting_branding_path = |
| 26 | rebase_path(_remoting_branding_abspath, root_build_dir) |
Brett Wilson | 1c69399 | 2014-08-25 19:10:01 | [diff] [blame] | 27 | |
Jamie Walch | d2e3827 | 2019-08-28 02:28:11 | [diff] [blame] | 28 | _template = |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 29 | "mac_native_messaging_bundle = \"@MAC_NATIVE_MESSAGING_HOST_BUNDLE_NAME@\" " |
| 30 | _template += "mac_remote_assistance_bundle = \"@MAC_REMOTE_ASSISTANCE_HOST_BUNDLE_NAME@\" " |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 31 | _template += "host_bundle_name = \"@MAC_HOST_BUNDLE_NAME@\" " |
Jamie Walch | d2e3827 | 2019-08-28 02:28:11 | [diff] [blame] | 32 | _template += "host_legacy_bundle_name = \"@MAC_HOST_LEGACY_BUNDLE_NAME@\" " |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 33 | _template += "host_name= \"@MAC_HOST_PACKAGE_NAME@\" " |
| 34 | _template += "host_service_name = \"@DAEMON_FILE_NAME@\" " |
| 35 | _template += "bundle_prefix = \"@MAC_UNINSTALLER_BUNDLE_PREFIX@\" " |
| 36 | _template += "host_uninstaller_name = \"@MAC_UNINSTALLER_NAME@\" " |
| 37 | _template += "version_patch = \"@REMOTING_PATCH@\" " |
| 38 | |
| 39 | if (is_mac) { |
| 40 | _template += "host_bundle_id = \"@MAC_HOST_BUNDLE_ID@\" " |
| 41 | _template += "native_messaging_host_bundle_id = \"@MAC_NATIVE_MESSAGING_HOST_BUNDLE_ID@\"" |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 42 | _template += "remote_assistance_host_bundle_id = \"@MAC_REMOTE_ASSISTANCE_HOST_BUNDLE_ID@\" " |
| 43 | _template += "uninstaller_bundle_id = \"@MAC_UNINSTALLER_BUNDLE_ID@\"" |
| 44 | } |
kelvinp | 98a75069 | 2014-11-12 21:31:43 | [diff] [blame] | 45 | |
nicholss | 28f74dd | 2017-01-27 16:14:10 | [diff] [blame] | 46 | if (is_ios) { |
| 47 | _template += "ios_bundle_id = \"@IOS_BUNDLE_ID@\"" |
| 48 | _template += "ios_display_name = \"@IOS_DISPLAY_NAME@\"" |
| 49 | _template += "ios_exec_name = \"@IOS_EXEC_NAME@\"" |
| 50 | _template += "ios_product_name = \"@IOS_PRODUCT_NAME@\"" |
| 51 | } |
| 52 | |
nicholss | e6fb262 | 2016-06-15 18:11:06 | [diff] [blame] | 53 | _result = exec_script(_version_py_abspath, |
| 54 | [ |
| 55 | "-f", |
| 56 | _remoting_branding_path, |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 57 | "-f", |
| 58 | _remoting_version_path, |
nicholss | e6fb262 | 2016-06-15 18:11:06 | [diff] [blame] | 59 | "-t", |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 60 | _template, |
nicholss | e6fb262 | 2016-06-15 18:11:06 | [diff] [blame] | 61 | ], |
| 62 | "scope", |
| 63 | remoting_version_files) |
| 64 | |
dpranke | 90f80f7 | 2016-06-30 00:24:34 | [diff] [blame] | 65 | host_name = _result.host_name |
| 66 | host_service_name = _result.host_service_name |
| 67 | bundle_prefix = _result.bundle_prefix |
| 68 | host_uninstaller_name = _result.host_uninstaller_name |
Jamie Walch | d2e3827 | 2019-08-28 02:28:11 | [diff] [blame] | 69 | me2me_host_bundle_name = _result.host_bundle_name |
| 70 | me2me_host_legacy_bundle_name = _result.host_legacy_bundle_name |
nicholss | e6fb262 | 2016-06-15 18:11:06 | [diff] [blame] | 71 | native_messaging_host_bundle_name = _result.mac_native_messaging_bundle |
| 72 | remote_assistance_host_bundle_name = _result.mac_remote_assistance_bundle |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 73 | remoting_version_patch = _result.version_patch |
| 74 | remoting_version_short = |
| 75 | "$chrome_version_major.$remoting_version_patch.$chrome_version_build" |
| 76 | remoting_version_full = "$remoting_version_short.$chrome_version_patch" |
| 77 | |
| 78 | if (is_mac) { |
| 79 | host_bundle_id = _result.host_bundle_id |
| 80 | native_messaging_host_bundle_id = _result.native_messaging_host_bundle_id |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 81 | remote_assistance_host_bundle_id = _result.remote_assistance_host_bundle_id |
| 82 | uninstaller_bundle_id = _result.uninstaller_bundle_id |
nicholss | 9e01f125 | 2016-10-18 00:45:01 | [diff] [blame] | 83 | |
| 84 | host_name_nospace = exec_script("//remoting/tools/remove_spaces.py", |
| 85 | [ "$host_name" ], |
| 86 | "trim string") |
| 87 | host_service_name_nospace = exec_script("//remoting/tools/remove_spaces.py", |
| 88 | [ "$host_service_name" ], |
| 89 | "trim string") |
| 90 | host_uninstaller_name_nospace = |
| 91 | exec_script("//remoting/tools/remove_spaces.py", |
| 92 | [ "$host_uninstaller_name" ], |
| 93 | "trim string") |
rsesek | c311f11 | 2016-07-23 03:35:52 | [diff] [blame] | 94 | } |
nicholss | 28f74dd | 2017-01-27 16:14:10 | [diff] [blame] | 95 | |
| 96 | if (is_ios) { |
| 97 | remoting_ios_bundle_id = _result.ios_bundle_id |
| 98 | remoting_ios_display_name = _result.ios_display_name |
| 99 | remoting_ios_executable_name = _result.ios_exec_name |
| 100 | remoting_ios_product_name = _result.ios_product_name |
| 101 | } |