mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-22 05:42:33 +03:00
129 lines
4.3 KiB
Ruby
129 lines
4.3 KiB
Ruby
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
|
|
# $RNFirebaseAsStaticFramework = true
|
|
# 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
|
|
platform :ios, min_ios_version_supported
|
|
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
|
|
|
|
|
|
|
|
target 'Ecency' do
|
|
|
|
use_expo_modules!
|
|
post_integrate do |installer|
|
|
begin
|
|
expo_patch_react_imports!(installer)
|
|
rescue => e
|
|
Pod::UI.warn e
|
|
end
|
|
end
|
|
|
|
config = use_native_modules!
|
|
|
|
|
|
permissions_path = '../node_modules/react-native-permissions/ios'
|
|
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
|
|
# Pods for Ecency
|
|
|
|
use_react_native!(
|
|
:path => config[:reactNativePath],
|
|
|
|
# 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,
|
|
# An absolute path to your application root.
|
|
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
)
|
|
|
|
target 'EcencyTests' do
|
|
inherit! :complete
|
|
# Pods for testing
|
|
end
|
|
|
|
|
|
# Convert all permission pods into static libraries
|
|
pre_install do |installer|
|
|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
|
|
|
|
installer.pod_targets.each do |pod|
|
|
if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
|
|
def pod.build_type;
|
|
# Uncomment the line corresponding to your CocoaPods version
|
|
Pod::BuildType.static_library # >= 1.9
|
|
# Pod::Target::BuildType.static_library # < 1.9
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
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
|
|
)
|
|
|
|
|
|
installer.pods_project.targets.each do |target|
|
|
|
|
#workarounf for xcode 14 archive signing issue
|
|
#ref:https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1201464693
|
|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
|
|
target.build_configurations.each do |config|
|
|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
|
|
end
|
|
end
|
|
|
|
target.build_configurations.each do |config|
|
|
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
|
|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
|
|
end
|
|
|
|
#this workaround resolves duplicate symbolds caused by GCDAsyncSocket inclusion in TcpSockets
|
|
if target.name == 'TcpSockets'
|
|
source_files = target.source_build_phase.files
|
|
gcd_async_socket = source_files[0] #First file in build phases is GCDAsyncSocket.m, chage index if not the case
|
|
puts "Deleting source file #{gcd_async_socket.inspect} from target #{target.inspect}."
|
|
source_files.delete gcd_async_socket
|
|
end
|
|
|
|
#workaround for resolving React-Codegen build failure on Xcode 14.3 (iOS 16.4) simulators - 'value' is unavailable
|
|
if target.name == 'React-Codegen'
|
|
target.build_configurations.each do |config|
|
|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
target 'ImageNotifi' do
|
|
pod 'Firebase/Messaging'
|
|
end
|