From b3939e5cd1b59a753f14513565f783c757657b3a Mon Sep 17 00:00:00 2001 From: Joe Susnick Date: Tue, 23 Feb 2021 09:06:50 -0800 Subject: [PATCH] Fix Build Warnings for SPM with Xcode 12.5 Beta 2 (#1661) Summary: Pull Request resolved: https://github.com/facebook/facebook-ios-sdk/pull/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 --- .../FBSDKCoreKit.xcodeproj/project.pbxproj | 8 +++++ FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h | 10 +++--- .../FBSDKCoreKit_Basics/FBSDKUserDataStore.m | 1 - .../include/FBSDKUserDataStore+Internal.h | 35 ------------------- 4 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 Sources/FBSDKCoreKit_Basics/include/FBSDKUserDataStore+Internal.h diff --git a/FBSDKCoreKit/FBSDKCoreKit.xcodeproj/project.pbxproj b/FBSDKCoreKit/FBSDKCoreKit.xcodeproj/project.pbxproj index 35513d21e4..f5ca86e7aa 100644 --- a/FBSDKCoreKit/FBSDKCoreKit.xcodeproj/project.pbxproj +++ b/FBSDKCoreKit/FBSDKCoreKit.xcodeproj/project.pbxproj @@ -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 */; }; @@ -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 */, @@ -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 */, @@ -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 */, diff --git a/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h b/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h index 944032d8e4..aece114930 100644 --- a/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h +++ b/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h @@ -27,6 +27,8 @@ #import #import #import + #import + #import #import #import #import @@ -51,9 +53,6 @@ #import #import #import - #else - #import - #import #endif #else @@ -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" @@ -89,9 +90,6 @@ #import "FBSDKProfilePictureView.h" #import "FBSDKURL.h" #import "FBSDKWebViewAppLinkResolver.h" - #else - #import "FBSDKDeviceButton.h" - #import "FBSDKDeviceViewControllerBase.h" #endif #endif diff --git a/Sources/FBSDKCoreKit_Basics/FBSDKUserDataStore.m b/Sources/FBSDKCoreKit_Basics/FBSDKUserDataStore.m index f2384c4540..be28ec9148 100644 --- a/Sources/FBSDKCoreKit_Basics/FBSDKUserDataStore.m +++ b/Sources/FBSDKCoreKit_Basics/FBSDKUserDataStore.m @@ -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" diff --git a/Sources/FBSDKCoreKit_Basics/include/FBSDKUserDataStore+Internal.h b/Sources/FBSDKCoreKit_Basics/include/FBSDKUserDataStore+Internal.h deleted file mode 100644 index 2804ed010a..0000000000 --- a/Sources/FBSDKCoreKit_Basics/include/FBSDKUserDataStore+Internal.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. -// -// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, -// copy, modify, and distribute this software in source code or binary form for use -// in connection with the web services and APIs provided by Facebook. -// -// As with any software that integrates with the Facebook platform, your use of -// this software is subject to the Facebook Developer Principles and Policies -// [http://developers.facebook.com/policy/]. This copyright notice shall be -// included in all copies or substantial portions of the software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#import - -#import "FBSDKUserDataStore.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface FBSDKUserDataStore (Internal) - -+ (void)setInternalHashData:(nullable NSString *)hashData - forType:(FBSDKAppEventUserDataType)type; -+ (void)setEnabledRules:(NSArray *)rules; - -+ (nullable NSString *)getInternalHashedDataForType:(FBSDKAppEventUserDataType)type; - -@end - -NS_ASSUME_NONNULL_END