在我的项目中,我引用了我公司使用的几个私有pod。其中一个称为DKKit的pod依赖于另一个我称为BaseProKit的私有pod。 BaseProKit包含3个框架,它在其标题和实现文件中引用,我认为它们被认为是vendored_frameworks
。在BaseProKit的现有头文件中,通过像#import <PPCommon/PPCommon>
这样的导入引用了这些框架,这些引用在编译时工作得很好(通常),而仅依赖于BaseProKit pod。但是,当包含DKKit时,DKKit在导入(BaseProKit.h
)时会查找包含上述导入的标题别名。然而,在DKKit的上下文中,看起来DKKit pod并不知道PPCommon框架的存在,它只看到它的头文件&#39;通过Pods-BaseProKit引用的别名。因此,对<PPCommon/ANYTHING>
的任何和所有引用都会产生编译错误(未找到),而我到目前为止唯一可以解决的方法是仅通过#import "PPCommon.h"
引用要求我调整整个BaseProKit项目中的所有导入,这感觉不对。
我已包含以下文件供参考: BaseProKit的Podspec:
s.name = "BaseProKit"
s.version = "1.0.5"
s.source_files = "BaseProKit/BaseProKit.h",
"BaseProKit/Data/*.{h,m}",
"BaseProKit/Sensor Calibration/*.{h,m}",
"BaseProKit/SP3D/BaseballSceneController/*.{h,m}",
"BaseProKit/SP3D/SceneElements/*.{h,m,hpp,cpp}",
"BaseProKit/SP3D/SceneEnvironment/*.{h,m}",
"BaseProKit/Third Party/DeviceModelDetector.{h,m}",
"BaseProKit/Third Party/SkyProKitEmptyMMFile.{h,mm}"
s.resources = "BaseProKit/SatelliteLibrary/SatelliteLibrary.bundle","BaseProKit/SP3D/SP3DResources.bundle", "BaseProKit/SP3D/Models/Vertex Data/*"
s.frameworks = "GLKit", "OpenGLES", "Foundation", "UIKit", "Accelerate", "PPCommon", "SatelliteLibrary", "SP3D"
s.library = 'c++'
s.prefix_header_file = "BaseProKit/BaseProKit-Prefix.pch"
# s.public_header_files = "BaseProKit/PPCommon/PPCommon.framework/Headers/*.h", "BaseProKit/SatelliteLibrary/SatelliteLibrary.framework/Headers/*.h", "BaseProKit/SP3D/SP3D.framework/Headers/*.h"
s.vendored_frameworks = "BaseProKit/PPCommon/PPCommon.framework",
"BaseProKit/SatelliteLibrary/SatelliteLibrary.framework",
"BaseProKit/SP3D/SP3D.framework"
DKKit的Podspec:
s.name = "DKKit"
s.version = "1.0.0"
s.source_files = 'DKKit/**/*.{h,m}'
s.resources = 'DKKit/**/*.xcdatamodeld'
s.dependency 'PromiseKit/Promise', '~> 1.3.0'
s.dependency 'MBProgressHUD', '~> 0.9.1'
s.prefix_header_contents = '#import "NSDictionary+Merge.h"'
s.frameworks = 'CoreData'
s.dependency 'BaseProKit', '~> 1.0.5'
s.dependency 'SwingAnalysisKit', '~> 1.0.0'
我的项目的Podfile:
pod 'SwingAnalysisKit', :git => "https://swing-analysis-kit-URL", :branch => "develop"
pod 'BaseProKit', :git => "https://base-pro-kit-URL", :branch => "develop"
pod 'DKKit', :git => "https://DKKit-URL", :branch => "develop"
我的任何podspec文件(特别是BaseProKit文件)中有什么不同的做法可以确保这些框架可以作为框架引用(而不仅仅是它们的头文件) Pod本身?
将此复制到Cocoapods / Cocoapods存储库也是一个问题: https://github.com/CocoaPods/CocoaPods/issues/3810