|
|
|
@ -1,8 +1,6 @@ |
|
|
|
# Define a global platform for your project |
|
|
|
platform :ios, '16.0' |
|
|
|
|
|
|
|
$FirebaseSDKVersion = '11.13.0' |
|
|
|
|
|
|
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. |
|
|
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true' |
|
|
|
|
|
|
|
@ -40,6 +38,31 @@ target 'Runner' do |
|
|
|
end |
|
|
|
|
|
|
|
post_install do |installer| |
|
|
|
# ---- Auto patch: bridge symlink for swift_sdk_local ---- |
|
|
|
# local_plugins/chat_api/ios/chat_api/Package.swift 用 path 引用 |
|
|
|
# `../../../swift_sdk_local`。Flutter 会把 chat_api 软链进 |
|
|
|
# ios/Flutter/ephemeral/Packages/.packages/chat_api,SwiftPM 解析这条相对路径时 |
|
|
|
# 用的是软链路径,会去 ios/Flutter/ephemeral/swift_sdk_local 找包。 |
|
|
|
# 这里建一条桥接软链让它能找到 local_plugins/swift_sdk_local。 |
|
|
|
ephemeral_dir = File.expand_path('Flutter/ephemeral', __dir__) |
|
|
|
if Dir.exist?(ephemeral_dir) |
|
|
|
bridge_link = File.join(ephemeral_dir, 'swift_sdk_local') |
|
|
|
bridge_target = '../../../local_plugins/swift_sdk_local' |
|
|
|
# 已存在且指向正确就跳过;否则重建 |
|
|
|
needs_create = true |
|
|
|
if File.symlink?(bridge_link) |
|
|
|
current = File.readlink(bridge_link) |
|
|
|
needs_create = (current != bridge_target) |
|
|
|
File.delete(bridge_link) if needs_create |
|
|
|
elsif File.exist?(bridge_link) |
|
|
|
raise "[Podfile patch] #{bridge_link} 已存在但不是软链,无法替换;请手动处理" |
|
|
|
end |
|
|
|
if needs_create |
|
|
|
File.symlink(bridge_target, bridge_link) |
|
|
|
puts "[Podfile patch] Created swift_sdk_local bridge symlink: #{bridge_link} -> #{bridge_target}" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
# ---- Auto patch: bump FlutterGeneratedPluginSwiftPackage iOS platform ---- |
|
|
|
# Flutter 生成的中介包总是写死 .iOS("12.0"),与 Podfile 中的 |
|
|
|
# platform :ios, '16.0' 不一致,会报 |
|
|
|
|