-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'player-testing/cavy-setup' into player-testing/add-play…
…er-testing-framework
- Loading branch information
Showing
6 changed files
with
91 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
android.useAndroidX=true | ||
BitmovinPlayerReactNative_kotlinVersion=1.7.0 | ||
BitmovinPlayerReactNative_minSdkVersion=21 | ||
BitmovinPlayerReactNative_targetSdkVersion=31 | ||
BitmovinPlayerReactNative_compileSdkVersion=31 | ||
BitmovinPlayerReactNative_targetSdkVersion=33 | ||
BitmovinPlayerReactNative_compileSdkVersion=33 | ||
BitmovinPlayerReactNative_ndkversion=21.4.7075529 | ||
BitmovinPlayerReactNative_androidToolsVersion=7.4.2 | ||
BitmovinPlayerReactNative_ktlintVersion=11.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,102 @@ | ||
# Resolve react_native_pods.rb with node to allow for hoisting | ||
require Pod::Executable.execute_command('node', ['-p', | ||
'require.resolve( | ||
"react-native/scripts/react_native_pods.rb", | ||
{paths: [process.argv[1]]}, | ||
)', __dir__]).strip | ||
require_relative '../node_modules/react-native/scripts/react_native_pods' | ||
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | ||
|
||
source 'https://cdn.cocoapods.org' | ||
source 'https://github.com/bitmovin/cocoapod-specs.git' | ||
source 'https://github.com/react-native-tvos/react-native-tvos-podspecs.git' | ||
|
||
platform :ios, 14.0 | ||
prepare_react_native_project! | ||
|
||
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. | ||
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded | ||
# | ||
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` | ||
# ```js | ||
# module.exports = { | ||
# dependencies: { | ||
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), | ||
# ``` | ||
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled | ||
|
||
linkage = ENV['USE_FRAMEWORKS'] | ||
if linkage != nil | ||
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green | ||
use_frameworks! :linkage => linkage.to_sym | ||
end | ||
def setup os | ||
inhibit_all_warnings! | ||
platform os, '14.0' | ||
|
||
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. | ||
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded | ||
# | ||
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` | ||
# ```js | ||
# module.exports = { | ||
# dependencies: { | ||
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), | ||
# ``` | ||
flipper_config = (ENV['NO_FLIPPER'] == "1" || os != :ios) ? FlipperConfiguration.disabled : FlipperConfiguration.enabled | ||
linkage = ENV['USE_FRAMEWORKS'] | ||
if linkage != nil | ||
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green | ||
use_frameworks! :linkage => linkage.to_sym | ||
end | ||
|
||
target 'IntegrationTest' do | ||
config = use_native_modules! | ||
|
||
# Flags change depending on the env values. | ||
flags = get_default_flags() | ||
|
||
use_react_native!( | ||
:path => config[:reactNativePath], | ||
# Hermes is now enabled by default. Disable by setting this flag to false. | ||
# Upcoming versions of React Native may rely on get_default_flags(), but | ||
# we make it explicit here to aid in the React Native upgrade process. | ||
:hermes_enabled => flags[:hermes_enabled], | ||
:fabric_enabled => flags[:fabric_enabled], | ||
# Enables Flipper. | ||
# | ||
# Note that if you have use_frameworks! enabled, Flipper will not work and | ||
# you should disable the next line. | ||
:flipper_configuration => flipper_config, | ||
:path => config[:reactNativePath], | ||
# An absolute path to your application root. | ||
:app_path => "#{Pod::Config.instance.installation_root}/.." | ||
) | ||
|
||
post_install do |installer| | ||
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 | ||
react_native_post_install( | ||
installer, | ||
config[:reactNativePath], | ||
:mac_catalyst_enabled => false | ||
) | ||
__apply_Xcode_12_5_M1_post_install_workaround(installer) | ||
pod 'RNBitmovinPlayer', :path => '../..' | ||
end | ||
|
||
target 'IntegrationTest' do | ||
setup :ios | ||
end | ||
|
||
post_install do |installer| | ||
react_native_post_install( | ||
installer, | ||
# Set `mac_catalyst_enabled` to `true` in order to apply patches | ||
# necessary for Mac Catalyst builds | ||
:mac_catalyst_enabled => false | ||
) | ||
__apply_Xcode_12_5_M1_post_install_workaround(installer) | ||
fix_simulator_run(installer) | ||
fix_deployment_target(installer) | ||
end | ||
|
||
def fix_simulator_run(installer) | ||
installer.pods_project.targets.each do |target| | ||
target.build_configurations.each do |config| | ||
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" | ||
config.build_settings["EXCLUDED_ARCHS[sdk=appletvsimulator*]"] = "i386" | ||
end | ||
end | ||
end | ||
|
||
def fix_deployment_target(installer) | ||
return if !installer | ||
project = installer.pods_project | ||
project_deployment_target_iOS = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] | ||
project_deployment_target_tvOS = project.build_configurations.first.build_settings['TVOS_DEPLOYMENT_TARGET'] | ||
|
||
project.targets.each do |target| | ||
target.build_configurations.each do |config| | ||
old_target_iOS = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] | ||
unless old_target_iOS.nil? | ||
new_target_iOS = project_deployment_target_iOS | ||
next if old_target_iOS.to_f >= new_target_iOS.to_f | ||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = new_target_iOS | ||
end | ||
|
||
old_target_tvOS = config.build_settings['TVOS_DEPLOYMENT_TARGET'] | ||
unless old_target_tvOS.nil? | ||
new_target_tvOS = project_deployment_target_tvOS | ||
next if old_target_tvOS.to_f >= new_target_tvOS.to_f | ||
config.build_settings['TVOS_DEPLOYMENT_TARGET'] = new_target_tvOS | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters