|
@@ -1,10 +1,5 @@
|
|
|
|
|
+require_relative '../node_modules/react-native/scripts/react_native_pods.rb'
|
|
|
# Resolve react_native_pods.rb with node to allow for hoisting
|
|
# 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-community/cli-platform-ios/native_modules'
|
|
|
|
|
def node_require(script)
|
|
def node_require(script)
|
|
|
# Resolve script with node to allow for hoisting
|
|
# Resolve script with node to allow for hoisting
|
|
|
require Pod::Executable.execute_command('node', ['-p',
|
|
require Pod::Executable.execute_command('node', ['-p',
|
|
@@ -13,10 +8,11 @@ def node_require(script)
|
|
|
{paths: [process.argv[1]]},
|
|
{paths: [process.argv[1]]},
|
|
|
)", __dir__]).strip
|
|
)", __dir__]).strip
|
|
|
end
|
|
end
|
|
|
-node_require('react-native/scripts/react_native_pods.rb')
|
|
|
|
|
|
|
+
|
|
|
|
|
+#node_require('react-native/scripts/react_native_pods.rb')
|
|
|
node_require('react-native-permissions/scripts/setup.rb')
|
|
node_require('react-native-permissions/scripts/setup.rb')
|
|
|
|
|
|
|
|
-platform :ios, '13.0'
|
|
|
|
|
|
|
+platform :ios, '15.1'
|
|
|
prepare_react_native_project!
|
|
prepare_react_native_project!
|
|
|
|
|
|
|
|
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
|
|
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
|
|
@@ -29,7 +25,7 @@ prepare_react_native_project!
|
|
|
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
|
|
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
|
|
|
# ```
|
|
# ```
|
|
|
#flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
|
|
#flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
|
|
|
-flipper_config = FlipperConfiguration.disabled;
|
|
|
|
|
|
|
+#flipper_config = FlipperConfiguration.disabled;
|
|
|
|
|
|
|
|
linkage = ENV['USE_FRAMEWORKS']
|
|
linkage = ENV['USE_FRAMEWORKS']
|
|
|
if linkage != nil
|
|
if linkage != nil
|
|
@@ -62,13 +58,17 @@ setup_permissions([
|
|
|
target 'Strides' do
|
|
target 'Strides' do
|
|
|
config = use_native_modules!
|
|
config = use_native_modules!
|
|
|
|
|
|
|
|
- # Flags change depending on the env values.
|
|
|
|
|
- flags = get_default_flags()
|
|
|
|
|
|
|
+ use_react_native!(
|
|
|
|
|
+ :path => config[:reactNativePath],
|
|
|
|
|
+ :fabric_enabled => true,
|
|
|
|
|
+ # An absolute path to your application root.
|
|
|
|
|
+ :app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
# 谷歌地图服务
|
|
# 谷歌地图服务
|
|
|
- pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
|
|
|
|
|
|
|
+ # pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
|
|
|
rn_maps_path = '../node_modules/react-native-maps'
|
|
rn_maps_path = '../node_modules/react-native-maps'
|
|
|
- pod 'react-native-google-maps', :path => rn_maps_path
|
|
|
|
|
|
|
+ pod 'react-native-maps/Google', :path => rn_maps_path
|
|
|
# pod 'GoogleMaps', '3.5.0'
|
|
# pod 'GoogleMaps', '3.5.0'
|
|
|
# pod 'Google-Maps-iOS-Utils', '2.1.0'
|
|
# pod 'Google-Maps-iOS-Utils', '2.1.0'
|
|
|
|
|
|
|
@@ -77,118 +77,45 @@ target 'Strides' do
|
|
|
pod 'FirebaseCore'
|
|
pod 'FirebaseCore'
|
|
|
pod 'FirebaseAnalytics'
|
|
pod 'FirebaseAnalytics'
|
|
|
pod 'FirebaseMessaging'
|
|
pod 'FirebaseMessaging'
|
|
|
|
|
+ pod 'FirebaseCrashlytics'
|
|
|
|
|
+ pod 'GoogleDataTransport', :modular_headers => true
|
|
|
|
|
+ pod 'nanopb', :modular_headers => true
|
|
|
# pod 'FirebaseFirestore'
|
|
# pod 'FirebaseFirestore'
|
|
|
pod 'GoogleUtilities', :modular_headers => true
|
|
pod 'GoogleUtilities', :modular_headers => true
|
|
|
|
|
|
|
|
- use_react_native!(
|
|
|
|
|
- :path => config[:reactNativePath],
|
|
|
|
|
- # Hermes is now enabled by default. Disable by setting this flag to false.
|
|
|
|
|
- :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,
|
|
|
|
|
- # An absolute path to your application root.
|
|
|
|
|
- :app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- target 'StridesTests' do
|
|
|
|
|
- inherit! :complete
|
|
|
|
|
- # Pods for testing
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- # Enables Flipper.
|
|
|
|
|
- #
|
|
|
|
|
- # Note that if you have use_frameworks! enabled, Flipper will not work and
|
|
|
|
|
- # you should disable the next line.
|
|
|
|
|
- # use_flipper!()
|
|
|
|
|
- # use_flipper!({'Flipper' => '0.182.0', 'Flipper-Folly' => '2.6.10', 'Flipper-RSocket' => '1.3.1'})
|
|
|
|
|
-
|
|
|
|
|
- #post_install do |installer|
|
|
|
|
|
- # react_native_post_install(installer)
|
|
|
|
|
- #end
|
|
|
|
|
-
|
|
|
|
|
- #--------------------修复iOS 16.4新建RN0.64无法运行--------------------------
|
|
|
|
|
- # post_install do |installer|
|
|
|
|
|
- # react_native_post_install(installer)
|
|
|
|
|
- # fix_library_search_paths(installer)
|
|
|
|
|
- # installer.pods_project.build_configurations.each do |config|
|
|
|
|
|
- # config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
|
|
|
|
|
|
|
+ # target 'StridesTests' do
|
|
|
|
|
+ # inherit! :complete
|
|
|
|
|
+ # # Pods for testing
|
|
|
# end
|
|
# end
|
|
|
- #end
|
|
|
|
|
|
|
|
|
|
post_install do |installer|
|
|
post_install do |installer|
|
|
|
- react_native_post_install(
|
|
|
|
|
- installer,
|
|
|
|
|
- config[:reactNativePath],
|
|
|
|
|
- :mac_catalyst_enabled => false
|
|
|
|
|
- )
|
|
|
|
|
- fix_library_search_paths(installer)
|
|
|
|
|
- installer.pods_project.build_configurations.each do |config|
|
|
|
|
|
- config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
|
|
|
|
|
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "16.4"
|
|
|
|
|
- end
|
|
|
|
|
installer.pods_project.targets.each do |target|
|
|
installer.pods_project.targets.each do |target|
|
|
|
- target.build_configurations.each do |config|
|
|
|
|
|
- config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
|
|
|
|
|
- #config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "16.4"
|
|
|
|
|
|
|
+ if target.name == 'fmt'
|
|
|
|
|
+ target.build_configurations.each do |config|
|
|
|
|
|
+ # 1. 强制禁用 consteval,回退到运行时检查或旧版编译器行为
|
|
|
|
|
+ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
|
|
|
|
|
+ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'FMT_USE_CONSTEVAL=0'
|
|
|
|
|
+ end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
- __apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
|
|
|
- # 修复iOS 18编译问题
|
|
|
|
|
- bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
|
|
|
|
|
- def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
|
|
|
|
|
- framework_path = File.join(Dir.pwd, framework_relative_path)
|
|
|
|
|
- command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
|
|
|
|
|
- puts "Stripping bitcode: #{command}"
|
|
|
|
|
- system(command)
|
|
|
|
|
- end
|
|
|
|
|
- framework_paths = [
|
|
|
|
|
- #"Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket",
|
|
|
|
|
- "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/hermes",
|
|
|
|
|
- "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/Current/hermes",
|
|
|
|
|
- "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64/hermes.framework/hermes",
|
|
|
|
|
- "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes"
|
|
|
|
|
- ]
|
|
|
|
|
- framework_paths.each do |framework_relative_path|
|
|
|
|
|
- strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
|
|
|
|
|
- end
|
|
|
|
|
- end
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-def fix_library_search_paths(installer)
|
|
|
|
|
- def fix_config(config)
|
|
|
|
|
- lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"]
|
|
|
|
|
- if lib_search_paths
|
|
|
|
|
- if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
|
|
|
|
|
- # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1)
|
|
|
|
|
- # since the libraries there are only built for x86_64 and i386.
|
|
|
|
|
- lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)")
|
|
|
|
|
- lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
|
|
|
|
|
- if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\""))
|
|
|
|
|
- # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11
|
|
|
|
|
- lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift")
|
|
|
|
|
- end
|
|
|
|
|
|
|
+ # 2. 针对源码文件进行物理补丁(确保万无一失)
|
|
|
|
|
+ fmt_base = File.join(installer.sandbox.root, 'fmt', 'include', 'fmt', 'base.h')
|
|
|
|
|
+ if File.exist?(fmt_base)
|
|
|
|
|
+ content = File.read(fmt_base)
|
|
|
|
|
+ unless content.include?('// Xcode 26 workaround')
|
|
|
|
|
+ puts "Patching fmt/base.h for Xcode 26.4 compatibility..."
|
|
|
|
|
+ # 将检测到的 consteval 支持强制设为 0
|
|
|
|
|
+ patched = content.gsub('# define FMT_USE_CONSTEVAL 1', "# define FMT_USE_CONSTEVAL 0 // Xcode 26 workaround")
|
|
|
|
|
+ File.chmod(0644, fmt_base)
|
|
|
|
|
+ File.write(fmt_base, patched)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
+ # 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,
|
|
|
|
|
+ # :ccache_enabled => true
|
|
|
|
|
+ )
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
-
|
|
|
|
|
-# projects = installer.aggregate_targets
|
|
|
|
|
-# .map{ |t| t.user_project }
|
|
|
|
|
-# .uniq{ |p| p.path }
|
|
|
|
|
-# .push(installer.pods_project)
|
|
|
|
|
-
|
|
|
|
|
-# projects.each do |project|
|
|
|
|
|
-# project.build_configurations.each do |config|
|
|
|
|
|
-# fix_config(config)
|
|
|
|
|
-# end
|
|
|
|
|
-# project.native_targets.each do |target|
|
|
|
|
|
-# target.build_configurations.each do |config|
|
|
|
|
|
-# fix_config(config)
|
|
|
|
|
-# end
|
|
|
|
|
-# end
|
|
|
|
|
-# project.save()
|
|
|
|
|
-# end
|
|
|