当我执行pod install
时,它会将某些文件加倍,例如:
Pods/AWSAppSync/AWSAppSyncClient/Apollo/Sources/Apollo/GraphQLError 2.swift
Pods/AWSAppSync/AWSAppSyncClient/Apollo/Sources/Apollo/GraphQLExecutor 2.swift
Pods/AWSAppSync/AWSAppSyncClient/Apollo/Sources/Apollo/GraphQLInputValue 2.swift
Pods/AWSAppSync/AWSAppSyncClient/Apollo/Sources/Apollo/GraphQLOperation 2.swift
Pods/AWSAppSync/AWSAppSyncClient/Apollo/Sources/Apollo/GraphQLQueryWatcher 2.swift
许多不同的豆荚都会发生这种情况。我先做过pod deintegrate
,然后做过pod install
,以确保我没有错。
这是podfile(我必须用XXXX替换一些元素):
platform :ios, '11.4'
use_frameworks!
# https://github.com/CocoaPods/CocoaPods/issues/4629
install! 'cocoapods', :deterministic_uuids => false
def app_pods()
pod 'ReachabilitySwift', '~> 4.3'
pod 'AppsFlyerFramework', '~> 4.8'
pod 'segment-appsflyer-ios/StaticLibWorkaround', '~> 1.2'
pod 'Segment-Appboy'
pod 'SwiftLint'
pod 'Tracking'
pod 'Events'
pod 'Appboy-iOS-SDK', '~> 3.14.0'
pod 'Firebase/Core'
pod 'Firebase/Performance'
pod 'Fabric'
pod 'Crashlytics'
pod 'Layout', '0.6.38'
pod 'AWSCore'
pod 'AWSAppSync'
pod 'AWSMobileClient'
feature_pods()
end
def feature_pods()
pod 'XXXX', :path => 'XXXX/XXXX'
pod 'XXXX', :path => 'XXXX/XXXX'
end
project = Xcodeproj::Project.open 'XXXX.xcodeproj'
project.targets.each do |t|
target t.name do
if t.name == 'XXXXUIKitTests'
pod 'XXXX/Core', :path => 'XXXX/XXXX'
pod 'XXXX/Core', :path => 'XXXX/XXXX'
pod 'XXXX/UIKit', :path => 'XXXX/XXXX'
app_pods()
elsif t.name == 'XXXXCoreTests'
pod 'XXXX/Core', :path => 'XXXX/Woomera'
pod 'XXXX/XXXX/XXXX', :path => 'XXXX/XXXX'
pod 'XXXX/XXXX/XXXX', :path => 'XXXX/XXXX'
pod 'XXXX/XXXX', :path => 'XXXX/XXXX'
pod 'XXXX/Core', :path => 'XXXX/XXXX'
elsif t.name == 'AcceptanceTests'
platform :osx, '10.13'
pod 'XXXX'
pod 'XXXX/XXXX', :path => 'XXXX/XXXX'
elsif t.name == 'XXXXTests'
app_pods()
pod 'SwiftFormat/Core'
pod 'SwiftFormat/CLI'
pod 'Layout/CLI'
pod 'XXXX', :path => 'XXXX'
elsif not t.name.end_with? "NSE"
app_pods()
end
end
end
def inhibit_warnings_for_build_settings(build_settings)
if build_settings["OTHER_SWIFT_FLAGS"].nil?
build_settings["OTHER_SWIFT_FLAGS"] = "-suppress-warnings"
else
build_settings["OTHER_SWIFT_FLAGS"] += " -suppress-warnings"
end
build_settings["GCC_WARN_INHIBIT_ALL_WARNINGS"] = "YES"
end
def treat_warnings_as_errors_for_build_settings(build_settings)
build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = "NO"
build_settings['SWIFT_TREAT_WARNINGS_AS_ERRORS'] = "NO"
end
def should_treat_warnings_as_errors(installer, target_name)
return installer.development_pod_targets.map { |pod| pod.name }.include?(target_name)
end
def configure_warnings_for_target(installer, target_name, build_settings)
if should_treat_warnings_as_errors(installer, target_name)
treat_warnings_as_errors_for_build_settings(build_settings)
else
inhibit_warnings_for_build_settings(build_settings)
end
end
def configure_swift_version_for_target(target)
target.build_configurations.each do |config|
if target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX'
config.build_settings['SWIFT_VERSION'] = '4.2'
elsif target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX' || target.name == 'XXXX'
config.build_settings['SWIFT_VERSION'] = '5'
else
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
post_install do |installer|
# Fix Swift versions (some pods are behind main project)
installer.pods_project.targets.each do |target|
configure_swift_version_for_target(target)
end
# Fix provisioning profiles
installer.pods_project.build_configurations.each do |config|
config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
end
end
# Configure warnings
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
configure_warnings_for_target(installer, target.name, config.build_settings)
end
end
require './add_XXXX_tests'
add_tests do
core "XXXX/XXXX/*/Tests"
core "XXXX/XXXX/Tests"
uikit "XXXX/XXXX/Tests"
end
end