Skip to content

Commit

Permalink
Fix Build Warnings for SPM with Xcode 12.5 Beta 2 (#1661)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1661

Swift Package Manager (SPM) by convention will treat any files in the `include` directory of a target as public. Therefore they need to be present in the umbrella header. Typically this is the header with the target name, ex: `FBSDKCoreKit.h`.

For the target `FBSDKCoreKit_Basics` this means removing the internal header `FBSDKUserDataStore+Internal.h` since internal headers should not go in the `include` directory. Some internal methods are used by the meta indexer class but these were already declared in a private extension. Long term we will want to make these methods public but for now it makes sense to avoid adding them to the public interface.

For the target `FBSDKCoreKit` we have two types that are only compiled for tvOS. Since we already have them compilation-gated inline, it is not necessary to exclude them from compilation in the umbrella header. It would be better to do this but it is not strictly necessary and this fixes the warning. The part I really don't like about this fix is that it forces us to make those headers public in the Xcode project for targets that they really shouldn't be public for.

Differential Revision: D26609865

fbshipit-source-id: 6712ab9e5eb73beb7ae43164cb23b82323244740
  • Loading branch information
joesus authored and facebook-github-bot committed Feb 23, 2021
1 parent 1276e24 commit b3939e5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 42 deletions.
8 changes: 8 additions & 0 deletions FBSDKCoreKit/FBSDKCoreKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,10 @@
F496E5FE24E5D0D5006231A2 /* FakeTokenCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F496E5FD24E5D0D5006231A2 /* FakeTokenCache.swift */; };
F496E60F24E5D195006231A2 /* SampleAccessToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = F496E60E24E5D195006231A2 /* SampleAccessToken.swift */; };
F496E61224E6049A006231A2 /* AppDelegateObserverFake.swift in Sources */ = {isa = PBXBuildFile; fileRef = F496E61124E6049A006231A2 /* AppDelegateObserverFake.swift */; };
F4A2B1A525E56BF400DE13D9 /* FBSDKDeviceButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D9E16AA1CB46C7D00C8B68F /* FBSDKDeviceButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
F4A2B1BA25E56BF500DE13D9 /* FBSDKDeviceButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D9E16AA1CB46C7D00C8B68F /* FBSDKDeviceButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
F4A2B1D525E56C3200DE13D9 /* FBSDKDeviceViewControllerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D10A68B1CB38D5D00F42AC1 /* FBSDKDeviceViewControllerBase.h */; settings = {ATTRIBUTES = (Public, ); }; };
F4A2B1E325E56C3300DE13D9 /* FBSDKDeviceViewControllerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D10A68B1CB38D5D00F42AC1 /* FBSDKDeviceViewControllerBase.h */; settings = {ATTRIBUTES = (Public, ); }; };
F4A826B724EC6FAD00EB2CD4 /* FBSDKProfileTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A826B624EC6FAC00EB2CD4 /* FBSDKProfileTests.m */; };
F4AE435225508FEA00FA9DE6 /* FBSDKProfilePictureView+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = B301910D253622A2001A8DB0 /* FBSDKProfilePictureView+Internal.h */; };
F4BD4024241EEDE500B45D39 /* FBSDKTestCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = F4BD4023241EEDE500B45D39 /* FBSDKTestCoder.m */; };
Expand Down Expand Up @@ -2921,6 +2925,7 @@
81B71D4B1D19C87400933E93 /* FBSDKBridgeAPIResponse.h in Headers */,
FDAF4A8E2395D27900711C4C /* FBSDKModelUtility.h in Headers */,
F9A06DB82510FAD3007E6386 /* FBSDKAppEventsConfiguration.h in Headers */,
F4A2B1A525E56BF400DE13D9 /* FBSDKDeviceButton.h in Headers */,
81B71D4C1D19C87400933E93 /* FBSDKCoreKit+Internal.h in Headers */,
BFC02453237B6B8E00A596EE /* FBSDKTensor.hpp in Headers */,
F441659325CAFED900DAB0A5 /* FBSDKURLSessionTask.h in Headers */,
Expand Down Expand Up @@ -2978,6 +2983,7 @@
81B71D651D19C87400933E93 /* FBSDKBridgeAPIRequest.h in Headers */,
81B71D671D19C87400933E93 /* FBSDKWebDialogView.h in Headers */,
81B71D681D19C87400933E93 /* FBSDKServerConfiguration+Internal.h in Headers */,
F4A2B1E325E56C3300DE13D9 /* FBSDKDeviceViewControllerBase.h in Headers */,
81B71D6A1D19C87400933E93 /* FBSDKCloseIcon.h in Headers */,
F441659125CAFED900DAB0A5 /* FBSDKLibAnalyzer.h in Headers */,
5DBC72D22373793400A9D859 /* FBSDKModelManager.h in Headers */,
Expand Down Expand Up @@ -3139,8 +3145,10 @@
C5696F83209BBC35009C931F /* FBSDKViewHierarchy.h in Headers */,
C5EAFA5E255283C100458DF5 /* FBSDKUserDataStore+Internal.h in Headers */,
5E3AFFE7258C191200BE46AB /* FBSDKAuthenticationTokenHeader.h in Headers */,
F4A2B1BA25E56BF500DE13D9 /* FBSDKDeviceButton.h in Headers */,
9DA81AF61AA4EF3300B9FE0B /* FBSDKProfile.h in Headers */,
5DBC72D12373793300A9D859 /* FBSDKModelManager.h in Headers */,
F4A2B1D525E56C3200DE13D9 /* FBSDKDeviceViewControllerBase.h in Headers */,
C4FC99D9202CD5590038C5ED /* FBSDKHybridAppEventsScriptMessageHandler.h in Headers */,
52963A94215992F400C7B252 /* FBSDKWebViewAppLinkResolver.h in Headers */,
5D4360DB23219F7900254DF7 /* FBSDKCrashObserver.h in Headers */,
Expand Down
10 changes: 4 additions & 6 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#import <FBSDKCoreKit/FBSDKButton.h>
#import <FBSDKCoreKit/FBSDKConstants.h>
#import <FBSDKCoreKit/FBSDKCopying.h>
#import <FBSDKCoreKit/FBSDKDeviceButton.h>
#import <FBSDKCoreKit/FBSDKDeviceViewControllerBase.h>
#import <FBSDKCoreKit/FBSDKGraphRequest.h>
#import <FBSDKCoreKit/FBSDKGraphRequestConnection.h>
#import <FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h>
Expand All @@ -51,9 +53,6 @@
#import <FBSDKCoreKit/FBSDKProfilePictureView.h>
#import <FBSDKCoreKit/FBSDKURL.h>
#import <FBSDKCoreKit/FBSDKWebViewAppLinkResolver.h>
#else
#import <FBSDKCoreKit/FBSDKDeviceButton.h>
#import <FBSDKCoreKit/FBSDKDeviceViewControllerBase.h>
#endif

#else
Expand All @@ -65,6 +64,8 @@
#import "FBSDKButton.h"
#import "FBSDKConstants.h"
#import "FBSDKCopying.h"
#import "FBSDKDeviceButton.h"
#import "FBSDKDeviceViewControllerBase.h"
#import "FBSDKGraphRequest.h"
#import "FBSDKGraphRequestConnection.h"
#import "FBSDKGraphRequestDataAttachment.h"
Expand All @@ -89,9 +90,6 @@
#import "FBSDKProfilePictureView.h"
#import "FBSDKURL.h"
#import "FBSDKWebViewAppLinkResolver.h"
#else
#import "FBSDKDeviceButton.h"
#import "FBSDKDeviceViewControllerBase.h"
#endif

#endif
Expand Down
1 change: 0 additions & 1 deletion Sources/FBSDKCoreKit_Basics/FBSDKUserDataStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#import "FBSDKUserDataStore.h"
#import "FBSDKUserDataStore+Internal.h"

#import "FBSDKBasicUtility.h"
#import "FBSDKTypeUtility.h"
Expand Down
35 changes: 0 additions & 35 deletions Sources/FBSDKCoreKit_Basics/include/FBSDKUserDataStore+Internal.h

This file was deleted.

0 comments on commit b3939e5

Please sign in to comment.