From f920e7d46b6a43e6ce8e04bc591e514489465bd0 Mon Sep 17 00:00:00 2001 From: Roland Kakonyi Date: Tue, 19 Dec 2023 13:13:19 +0100 Subject: [PATCH 1/3] chore: simplify iOS development team setup --- .gitignore | 3 ++ CONTRIBUTING.md | 8 ++++ .../Debug.xcconfig | 2 + .../Release.xcconfig | 2 + .../project.pbxproj | 38 ++++++++++++++----- .../Debug.xcconfig | 2 + .../Release.xcconfig | 2 + example/ios/Podfile | 12 ++++++ example/ios/Podfile.lock | 2 +- 9 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 example/ios/BitmovinPlayerReactNativeExample-tvOS/Debug.xcconfig create mode 100644 example/ios/BitmovinPlayerReactNativeExample-tvOS/Release.xcconfig create mode 100644 example/ios/BitmovinPlayerReactNativeExample/Debug.xcconfig create mode 100644 example/ios/BitmovinPlayerReactNativeExample/Release.xcconfig diff --git a/.gitignore b/.gitignore index 9b61ac79..2d18b882 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ lib/ # generated API documentation docs/generated + +# developer specific configuration file +example/ios/Developer.xcconfig diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56359517..206c2302 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,6 +45,14 @@ To edit the Swift/Objective-C files, open `example/ios/BitmovinPlayerReactNative To edit the Kotlin files, open `example/android` in Android Studio and find the source files at `bitmovin-player-react-native` under `Android`. +## For iOS/tvOS on-device development + +To build the example project for an iOS or tvOS device, you need to create a file at `example/ios/Developer.xcconfig`. In this file, add your development team like this: + +```yml +DEVELOPMENT_TEAM = YOUR_TEAM_ID +``` + ## TypeScript Code Style - Follow the `eslint` rules (`yarn lint`). They are enforced automatically via a pre-commit git hook. diff --git a/example/ios/BitmovinPlayerReactNativeExample-tvOS/Debug.xcconfig b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Debug.xcconfig new file mode 100644 index 00000000..e65f91b3 --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/BitmovinPlayerReactNativeExample-tvOS/Release.xcconfig b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Release.xcconfig new file mode 100644 index 00000000..e1687e69 --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj b/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj index 8b7e58c1..f73e540d 100644 --- a/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj @@ -17,6 +17,10 @@ 4CE3830528BFD270002DDF82 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4CE3830428BFD270002DDF82 /* AppDelegate.mm */; }; 5915995436EFADAE00A71930 /* libPods-BitmovinPlayerReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 06D60B6FD8A3297CA32930A9 /* libPods-BitmovinPlayerReactNativeExample.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + A8DB69432B31B5DB00BAD718 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */; }; + A8DB69442B31B5DB00BAD718 /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69422B31B5DB00BAD718 /* Release.xcconfig */; }; + A8DB69472B31B61400BAD718 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69452B31B61400BAD718 /* Debug.xcconfig */; }; + A8DB69482B31B61400BAD718 /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69462B31B61400BAD718 /* Release.xcconfig */; }; B3861322686908F1A14AEDFF /* libPods-BitmovinPlayerReactNativeExample-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B0574780FC6EB7D0D35EDF5 /* libPods-BitmovinPlayerReactNativeExample-tvOS.a */; }; /* End PBXBuildFile section */ @@ -40,6 +44,10 @@ 7B0574780FC6EB7D0D35EDF5 /* libPods-BitmovinPlayerReactNativeExample-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BitmovinPlayerReactNativeExample-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 7D2D062A80C63508C52FD003 /* Pods-BitmovinPlayerReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BitmovinPlayerReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-BitmovinPlayerReactNativeExample/Pods-BitmovinPlayerReactNativeExample.debug.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = BitmovinPlayerReactNativeExample/LaunchScreen.storyboard; sourceTree = ""; }; + A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = BitmovinPlayerReactNativeExample/Debug.xcconfig; sourceTree = ""; }; + A8DB69422B31B5DB00BAD718 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = BitmovinPlayerReactNativeExample/Release.xcconfig; sourceTree = ""; }; + A8DB69452B31B61400BAD718 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + A8DB69462B31B61400BAD718 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; BDAFF5A7A0416D4C35F3B620 /* Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig"; sourceTree = ""; }; CAA1356D0B7800248D07E196 /* Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig"; path = "Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; @@ -76,6 +84,8 @@ 13B07FB61A68108700A75B9A /* Info.plist */, 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 13B07FB71A68108700A75B9A /* main.m */, + A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */, + A8DB69422B31B5DB00BAD718 /* Release.xcconfig */, ); name = BitmovinPlayerReactNativeExample; sourceTree = ""; @@ -100,6 +110,8 @@ 4CE382FE28BFD10E002DDF82 /* main.m */, 4CE3830328BFD1E2002DDF82 /* AppDelegate.h */, 4CE3830428BFD270002DDF82 /* AppDelegate.mm */, + A8DB69452B31B61400BAD718 /* Debug.xcconfig */, + A8DB69462B31B61400BAD718 /* Release.xcconfig */, ); path = "BitmovinPlayerReactNativeExample-tvOS"; sourceTree = ""; @@ -126,8 +138,9 @@ isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* BitmovinPlayerReactNativeExample */, - 832341AE1AAA6A7D00B99B32 /* Libraries */, 4CE382EF28BFD10C002DDF82 /* BitmovinPlayerReactNativeExample-tvOS */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + A8DB693E2B31B52C00BAD718 /* Supporting Files */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, 6B9684456A2045ADE5A6E47E /* Pods */, @@ -146,6 +159,13 @@ name = Products; sourceTree = ""; }; + A8DB693E2B31B52C00BAD718 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + name = "Supporting Files"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -239,8 +259,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A8DB69442B31B5DB00BAD718 /* Release.xcconfig in Resources */, 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + A8DB69432B31B5DB00BAD718 /* Debug.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -248,8 +270,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A8DB69482B31B61400BAD718 /* Release.xcconfig in Resources */, 4CE382FD28BFD10E002DDF82 /* LaunchScreen.storyboard in Resources */, 4CE382FA28BFD10E002DDF82 /* Assets.xcassets in Resources */, + A8DB69472B31B61400BAD718 /* Debug.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -564,7 +588,7 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7D2D062A80C63508C52FD003 /* Pods-BitmovinPlayerReactNativeExample.debug.xcconfig */; + baseConfigurationReference = A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++17"; @@ -572,7 +596,6 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = BitmovinPlayerReactNativeExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -593,7 +616,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4451A76D9ED45CF044433360 /* Pods-BitmovinPlayerReactNativeExample.release.xcconfig */; + baseConfigurationReference = A8DB69422B31B5DB00BAD718 /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++17"; @@ -601,7 +624,6 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = BitmovinPlayerReactNativeExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -620,7 +642,7 @@ }; 4CE3830028BFD10E002DDF82 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BDAFF5A7A0416D4C35F3B620 /* Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig */; + baseConfigurationReference = A8DB69452B31B61400BAD718 /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -633,7 +655,6 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "BitmovinPlayerReactNativeExample-tvOS/Info.plist"; @@ -658,7 +679,7 @@ }; 4CE3830128BFD10E002DDF82 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CAA1356D0B7800248D07E196 /* Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig */; + baseConfigurationReference = A8DB69462B31B61400BAD718 /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -672,7 +693,6 @@ CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "BitmovinPlayerReactNativeExample-tvOS/Info.plist"; diff --git a/example/ios/BitmovinPlayerReactNativeExample/Debug.xcconfig b/example/ios/BitmovinPlayerReactNativeExample/Debug.xcconfig new file mode 100644 index 00000000..1438a4d6 --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample/Pods-BitmovinPlayerReactNativeExample.debug.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/BitmovinPlayerReactNativeExample/Release.xcconfig b/example/ios/BitmovinPlayerReactNativeExample/Release.xcconfig new file mode 100644 index 00000000..f32ea81c --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample/Pods-BitmovinPlayerReactNativeExample.release.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile index 91eb4a8e..00fce221 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -70,6 +70,7 @@ post_install do |installer| __apply_Xcode_12_5_M1_post_install_workaround(installer) fix_simulator_run(installer) fix_deployment_target(installer) + disable_resource_bundle_signing(installer) end def fix_simulator_run(installer) @@ -105,3 +106,14 @@ def fix_deployment_target(installer) end end end + +def disable_resource_bundle_signing(installer) + installer.pods_project.targets.each do |target| + target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle' + target.build_configurations.each do |config| + if target_is_resource_bundle + config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' + end + end + end +end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index c1bf32f8..49d277a8 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -751,6 +751,6 @@ SPEC CHECKSUMS: Yoga: f67f5769ce78049c5fe798bc735f04535c7bc1ac YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 72e333b84551f3cbf0fe463cce703cb47a7372a6 +PODFILE CHECKSUM: 531b9f7c2ff19d5c33a14e9a441a3d3d22007a25 COCOAPODS: 1.14.2 From b20493e51839c4087f81424ae5c6cc51da47a26d Mon Sep 17 00:00:00 2001 From: Roland Kakonyi Date: Tue, 19 Dec 2023 14:32:52 +0100 Subject: [PATCH 2/3] chore: remove empty groups from Xcode project file --- .../project.pbxproj | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj b/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj index f73e540d..131a67b7 100644 --- a/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj @@ -127,20 +127,11 @@ path = Pods; sourceTree = ""; }; - 832341AE1AAA6A7D00B99B32 /* Libraries */ = { - isa = PBXGroup; - children = ( - ); - name = Libraries; - sourceTree = ""; - }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* BitmovinPlayerReactNativeExample */, 4CE382EF28BFD10C002DDF82 /* BitmovinPlayerReactNativeExample-tvOS */, - 832341AE1AAA6A7D00B99B32 /* Libraries */, - A8DB693E2B31B52C00BAD718 /* Supporting Files */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, 6B9684456A2045ADE5A6E47E /* Pods */, @@ -159,13 +150,6 @@ name = Products; sourceTree = ""; }; - A8DB693E2B31B52C00BAD718 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - ); - name = "Supporting Files"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ From ed4dfa5fb84bb88b10ee1f59b4632f836ab59bbe Mon Sep 17 00:00:00 2001 From: Roland Kakonyi Date: Tue, 19 Dec 2023 15:10:45 +0100 Subject: [PATCH 3/3] chore: add comments for Podfile workarounds --- example/ios/Podfile | 3 +++ integration_test/ios/Podfile | 2 ++ 2 files changed, 5 insertions(+) diff --git a/example/ios/Podfile b/example/ios/Podfile index 00fce221..ce6036e4 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -73,6 +73,7 @@ post_install do |installer| disable_resource_bundle_signing(installer) end +# Workaround for running on simulator on Apple Silicon from the command-line def fix_simulator_run(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| @@ -82,6 +83,7 @@ def fix_simulator_run(installer) end end +# Align deployment target of all targets in the Pods project with the main project def fix_deployment_target(installer) return if !installer project = installer.pods_project @@ -107,6 +109,7 @@ def fix_deployment_target(installer) end end +# Workaround against required code-signing for resource bundle targets def disable_resource_bundle_signing(installer) installer.pods_project.targets.each do |target| target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle' diff --git a/integration_test/ios/Podfile b/integration_test/ios/Podfile index 484273c8..639b6b6e 100644 --- a/integration_test/ios/Podfile +++ b/integration_test/ios/Podfile @@ -67,6 +67,7 @@ post_install do |installer| fix_simulator_run(installer) end +# Align deployment target of all targets in the Pods project with the main project def fix_deployment_target(installer) return if !installer project = installer.pods_project @@ -92,6 +93,7 @@ def fix_deployment_target(installer) end end +# Workaround for running on simulator on Apple Silicon from the command-line def fix_simulator_run(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config|