remoting_ios_tmpl.gni 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Copyright 2017 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/apple/tweak_info_plist.gni")
  5. import("//build/config/chrome_build.gni")
  6. import("//build/config/ios/rules.gni")
  7. import("//build/util/process_version.gni")
  8. import("//remoting/build/config/remoting_build.gni")
  9. import("//remoting/credits/credits.gni")
  10. _remoting_ios_app_source_dir = get_path_info("./", "abspath")
  11. # Arguments
  12. #
  13. # output_name:
  14. # string, the filename of the generated .app folder
  15. #
  16. # info_plist_path:
  17. # string, path of the Info.plist template
  18. #
  19. # entitlements_path:
  20. # string, path of the .entitlements file
  21. #
  22. # deps:
  23. # string array, deps to be compiled. E.g. source sets, launch screen, icons.
  24. #
  25. # bundle_id:
  26. # (optional) string, the bundle_id. If this is not set, it will come from
  27. # either branding_Chromium or branding_Chrome
  28. template("ios_remoting_app_tmpl") {
  29. _app_target_name = target_name
  30. _info_plist_target_name = "${target_name}_tweak_info_plist"
  31. tweak_info_plist(_info_plist_target_name) {
  32. info_plist = invoker.info_plist_path
  33. args = [ "--platform=ios" ]
  34. }
  35. _launchscreen_storyboard_target_name =
  36. "${target_name}_launchscreen_storyboard"
  37. bundle_data_ib_file(_launchscreen_storyboard_target_name) {
  38. source = rebase_path("resources/LaunchScreen.storyboard",
  39. ".",
  40. _remoting_ios_app_source_dir)
  41. }
  42. # Compiles the credits files into the gen directory.
  43. _credits_resources_target_name = "${target_name}_credits_resources"
  44. remoting_credits(_credits_resources_target_name) {
  45. app_target_gen_dir = get_label_info(":$_app_target_name", "target_gen_dir")
  46. credits_gen_dir =
  47. "${app_target_gen_dir}/${_app_target_name}_credits_resources"
  48. target_dir = get_path_info("./", "abspath")
  49. gn_target = "${target_dir}:${_app_target_name}"
  50. }
  51. # Adds the compiled credits files into the bundle.
  52. _credits_bundle_target_name = "${target_name}_credits_bundle"
  53. bundle_data(_credits_bundle_target_name) {
  54. sources = get_target_outputs(":$_credits_resources_target_name")
  55. public_deps = [ ":$_credits_resources_target_name" ]
  56. outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
  57. }
  58. ios_app_bundle(target_name) {
  59. forward_variables_from(invoker,
  60. [
  61. "bundle_deps",
  62. "deps",
  63. "output_name",
  64. ])
  65. entitlements_path = invoker.entitlements_path
  66. info_plist_target = ":$_info_plist_target_name"
  67. if (defined(invoker.bundle_id)) {
  68. bundle_identifier = invoker.bundle_id
  69. } else {
  70. bundle_identifier = remoting_ios_bundle_id
  71. }
  72. extra_substitutions = [
  73. "DISPLAY_NAME=$remoting_ios_display_name",
  74. "EXECUTABLE_NAME=$output_name",
  75. "PRODUCT_NAME=$output_name",
  76. "VERSION_FULL=$remoting_version_full",
  77. "VERSION_SHORT=$remoting_version_short",
  78. ]
  79. frameworks = [
  80. "Accelerate.framework",
  81. "AudioToolbox.framework",
  82. "CoreAudio.framework",
  83. "CoreData.framework",
  84. "CoreMIDI.framework",
  85. "CoreVideo.framework",
  86. "GLKit.framework",
  87. "OpenGLES.framework",
  88. "WebKit.framework",
  89. "SafariServices.framework",
  90. "SystemConfiguration.framework",
  91. ]
  92. if (!defined(bundle_deps)) {
  93. bundle_deps = []
  94. }
  95. bundle_deps += [
  96. ":$_credits_bundle_target_name",
  97. ":$_launchscreen_storyboard_target_name",
  98. ]
  99. assert_no_deps = [ "//third_party/ffmpeg:*" ]
  100. }
  101. }