Files
facebook-ios-sdk/FBSDKCoreKit.podspec
Joe Susnick 2324da800c Swift Rewrite Pre-work
Summary:
Reorganizes to set us up for a Swift rewrite.

One thing to note about this rewrite is that we cannot simply replace arbitrary files. The dependency graph is extremely important because Swift Package Manager does not support mixed Swift and Objective-C source files.

The high level goal is to maintain backwards compatibility for users importing FBSDKCoreKit while still moving the implementation to Swift under the hood.

To do this, we will need to introduce a new module, LegacyCoreKit which will serve as the source of existing ObjC files.

The existing Swift Package Manager module, FacebookCore, will depend on LegacyCoreKit and will host the top-level Swift files. Top-level in this case refers to those files with the fewest callers from inside the SDK itself; a prime example of this is ApplicationDelegate.

To maintain backwards compatibility for the interfaces, the existing module FBSDKCoreKit will be repurposed to provide wrapper interfaces for FacebookCore.

At the modular level, the dependency graph will look like this:

LegacyCoreKit    the original ObjC implementation undergoing the rewrite
 ↓
FacebookCore    the rewritten native Swift files
 ↓
FBSDKCoreKit    backwards compatible ObjC interfaces

There's still work to do for this including:
* Update CocoaPods to use follow the same structure of relying on an underlying module for the original ObjC implementation
* Update the Xcode targets to follow the same structure and use an underlying module for the original ObjC implementation
* Remove OCMock so that we are forced to restructure the dependencies to be injectable

Reviewed By: Oliverccccct

Differential Revision: D27855791

fbshipit-source-id: f3b5fbbe67492d3a131d475688e91ee8ab51ae6b
2021-04-23 09:44:40 -07:00

65 lines
2.7 KiB
Ruby

# Use the --use-libraries switch when pushing or linting this podspec
Pod::Spec.new do |s|
s.name = 'FBSDKCoreKit'
s.version = '9.2.0'
s.summary = 'Official Facebook SDK for iOS to access Facebook Platform core features'
s.description = <<-DESC
The Facebook SDK for iOS CoreKit framework provides:
* App Events (for App Analytics)
* Graph API Access and Error Recovery
* Working with Access Tokens and User Profiles
DESC
s.homepage = 'https://developers.facebook.com/docs/ios/'
s.license = { type: 'Facebook Platform License', file: 'LICENSE' }
s.author = 'Facebook'
s.platform = :ios, :tvos
s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '10.0'
s.source = {
git: 'https://github.com/facebook/facebook-ios-sdk.git',
tag: "v#{s.version}"
}
s.ios.weak_frameworks = 'Accelerate', 'Accounts', 'AdSupport', 'Social', 'Security', 'StoreKit', 'QuartzCore', 'CoreGraphics', 'UIKit', 'Foundation', 'AudioToolbox'
s.tvos.weak_frameworks = 'CoreLocation', 'Security', 'QuartzCore', 'CoreGraphics', 'UIKit', 'Foundation', 'AudioToolbox'
s.default_subspecs = 'Core', 'Basics'
s.swift_version = '5.0'
s.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS': '$(inherited) FBSDKCOCOAPODS=1',
'DEFINES_MODULE': 'YES'
}
s.user_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS': '$(inherited) FBSDKCOCOAPODS=1' }
s.library = 'c++', 'stdc++'
s.subspec 'Basics' do |ss|
ss.source_files = 'Sources/FBSDKCoreKit_Basics/**/*.{h,m}'
ss.private_header_files = 'Sources/FBSDKCoreKit_Basics/**/*+Internal.h'
ss.library = 'z'
end
s.subspec 'Core' do |ss|
ss.dependency 'FBSDKCoreKit/Basics'
ss.exclude_files = 'Sources/FBSDKCoreKit_Basics/**/*',
'FBSDKCoreKit/FBSDKCoreKit/include/**/*',
'FBSDKCoreKit/FBSDKCoreKit/Swift/Exports.swift'
ss.source_files = 'FBSDKCoreKit/FBSDKCoreKit/**/*.{h,hpp,m,mm}',
'Sources/FacebookCore/**/*.swift'
ss.public_header_files = 'FBSDKCoreKit/FBSDKCoreKit/*.h',
'FBSDKCoreKit/FBSDKCoreKit/AppEvents/*.h',
'FBSDKCoreKit/FBSDKCoreKit/AppLink/*.h',
'FBSDKCoreKit/FBSDKCoreKit/AppLink/Resolver/*.h',
'FBSDKCoreKit/FBSDKCoreKit/GraphAPI/*.h'
ss.private_header_files = 'FBSDKCoreKit/FBSDKCoreKit/Internal/**/*.h',
'FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/**/*.h'
ss.resource_bundles = { 'FacebookSDKStrings' => ['FacebookSDKStrings.bundle/**/*.strings'] }
ss.library = 'c++', 'stdc++'
end
end