diff --git a/Crashlytics/UnitTests/FIRCLSMetricKitManagerTests.m b/Crashlytics/UnitTests/FIRCLSMetricKitManagerTests.m index 005c08e37c0..7e51ca34026 100644 --- a/Crashlytics/UnitTests/FIRCLSMetricKitManagerTests.m +++ b/Crashlytics/UnitTests/FIRCLSMetricKitManagerTests.m @@ -16,7 +16,11 @@ #import #import "Crashlytics/Crashlytics/Controllers/FIRCLSMetricKitManager.h" + @import FirebaseCoreInternal; +#if SWIFT_PACKAGE +@import FirebaseCoreInternalObjC; +#endif #if CLS_METRICKIT_SUPPORTED diff --git a/Crashlytics/UnitTests/FIRCLSOnDemandModelTests.m b/Crashlytics/UnitTests/FIRCLSOnDemandModelTests.m index 83890a8a333..576b765b86b 100644 --- a/Crashlytics/UnitTests/FIRCLSOnDemandModelTests.m +++ b/Crashlytics/UnitTests/FIRCLSOnDemandModelTests.m @@ -34,6 +34,9 @@ #import "Crashlytics/Crashlytics/Settings/Models/FIRCLSApplicationIdentifierModel.h" @import FirebaseCoreInternal; +#if SWIFT_PACKAGE +@import FirebaseCoreInternalObjC; +#endif #define TEST_GOOGLE_APP_ID (@"1:632950151350:ios:d5b0d08d4f00f4b1") diff --git a/Crashlytics/UnitTests/FIRCLSReportManagerTests.m b/Crashlytics/UnitTests/FIRCLSReportManagerTests.m index 6e18132ed95..599967ffbf3 100644 --- a/Crashlytics/UnitTests/FIRCLSReportManagerTests.m +++ b/Crashlytics/UnitTests/FIRCLSReportManagerTests.m @@ -16,6 +16,9 @@ #import @import FirebaseCoreInternal; +#if SWIFT_PACKAGE +@import FirebaseCoreInternalObjC; +#endif #if __has_include() #import diff --git a/FirebaseABTesting.podspec b/FirebaseABTesting.podspec index d988bbac272..3258041c3bf 100644 --- a/FirebaseABTesting.podspec +++ b/FirebaseABTesting.podspec @@ -41,7 +41,6 @@ Firebase Cloud Messaging and Firebase Remote Config in your app. s.source_files = [ base_dir + '**/*.[mh]', 'Interop/Analytics/Public/*.h', - 'FirebaseCore/Extension/*.h', ] s.resource_bundles = { "#{s.module_name}_Privacy" => 'FirebaseABTesting/Sources/Resources/PrivacyInfo.xcprivacy' @@ -53,6 +52,7 @@ Firebase Cloud Messaging and Firebase Remote Config in your app. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"' } s.dependency 'FirebaseCore', '11.5' + s.dependency 'FirebaseCoreExtension', '11.5' s.test_spec 'unit' do |unit_tests| unit_tests.scheme = { :code_coverage => true } diff --git a/FirebaseAppCheck.podspec b/FirebaseAppCheck.podspec index a80ebd8451a..ab134e87bb0 100644 --- a/FirebaseAppCheck.podspec +++ b/FirebaseAppCheck.podspec @@ -36,7 +36,6 @@ Pod::Spec.new do |s| s.source_files = [ base_dir + 'Sources/**/*.[mh]', - 'FirebaseCore/Extension/*.h', ] s.public_header_files = base_dir + 'Sources/Public/FirebaseAppCheck/*.h' @@ -47,6 +46,7 @@ Pod::Spec.new do |s| s.dependency 'AppCheckCore', '~> 11.0' s.dependency 'FirebaseAppCheckInterop', '~> 11.0' s.dependency 'FirebaseCore', '11.5' + s.dependency 'FirebaseCoreExtension', '11.5' s.dependency 'GoogleUtilities/Environment', '~> 8.0' s.dependency 'GoogleUtilities/UserDefaults', '~> 8.0' diff --git a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m index 1732f3ca9ef..aeb9cb35758 100644 --- a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m +++ b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m @@ -26,6 +26,7 @@ #import "FirebaseAppCheck/Sources/Core/FIRAppCheckValidator.h" #import "FirebaseAppCheck/Sources/Core/FIRHeartbeatLogger+AppCheck.h" +@import FirebaseCoreExtension; @import FirebaseCoreInternal; #if SWIFT_PACKAGE @import FirebaseCoreInternalObjC; diff --git a/FirebaseCore.podspec b/FirebaseCore.podspec index c2ccb23fddc..363fa78c212 100644 --- a/FirebaseCore.podspec +++ b/FirebaseCore.podspec @@ -52,7 +52,6 @@ Firebase Core includes FIRApp and FIROptions which provide central configuration # Remember to also update version in `cmake/external/GoogleUtilities.cmake` s.dependency 'GoogleUtilities/Environment', '~> 8.0' - s.dependency 'GoogleUtilities/Logger', '~> 8.0' s.dependency 'FirebaseCoreInternal', '11.5' s.pod_target_xcconfig = { diff --git a/FirebaseCore/Tests/Unit/FIRComponentContainerTest.m b/FirebaseCore/Tests/Unit/FIRComponentContainerTest.m index 0dd156faf03..f696691cc41 100644 --- a/FirebaseCore/Tests/Unit/FIRComponentContainerTest.m +++ b/FirebaseCore/Tests/Unit/FIRComponentContainerTest.m @@ -14,11 +14,15 @@ #import "FirebaseCore/Tests/Unit/FIRTestCase.h" -#import "FirebaseCore/InternalObjC//FIRComponentType.h" +#import "FirebaseCore/Extension/FIRAppInternal.h" +#import "FirebaseCore/InternalObjC/FIRComponentContainer.h" #import "FirebaseCore/InternalObjC/FIRComponentContainerInternal.h" +#import "FirebaseCore/InternalObjC/FIRComponentType.h" #import "FirebaseCore/Tests/Unit/FIRTestComponents.h" #import "SharedTestUtilities/FIROptionsMock.h" +@import FirebaseCore; + /// Internally exposed methods and properties for testing. @interface FIRComponentContainer (TestInternal) diff --git a/FirebaseCore/Tests/Unit/FIRTestComponents.m b/FirebaseCore/Tests/Unit/FIRTestComponents.m index 8c461121dc5..dc73f5dc604 100644 --- a/FirebaseCore/Tests/Unit/FIRTestComponents.m +++ b/FirebaseCore/Tests/Unit/FIRTestComponents.m @@ -14,7 +14,11 @@ #import "FirebaseCore/Tests/Unit/FIRTestComponents.h" +#import "FirebaseCore/Extension/FIRAppInternal.h" +#import "FirebaseCore/InternalObjC/FIRComponentContainer.h" +#import "FirebaseCore/InternalObjC/FIRComponentContainerInternal.h" #import "FirebaseCore/InternalObjC/FIRComponentType.h" +#import "FirebaseCore/Tests/Unit/FIRTestComponents.h" #pragma mark - Standard Component diff --git a/FirebaseCoreInternal.podspec b/FirebaseCoreInternal.podspec index 85cfc2296f9..caaad7731e9 100644 --- a/FirebaseCoreInternal.podspec +++ b/FirebaseCoreInternal.podspec @@ -39,6 +39,8 @@ Pod::Spec.new do |s| s.swift_version = '5.9' + s.dependency 'GoogleUtilities/Environment', '~> 8.0' + s.dependency 'GoogleUtilities/Logger', '~> 8.0' s.dependency 'GoogleUtilities/NSData+zlib', '~> 8.0' s.pod_target_xcconfig = { diff --git a/FirebaseDatabase.podspec b/FirebaseDatabase.podspec index 834211167ba..b051f73b64a 100644 --- a/FirebaseDatabase.podspec +++ b/FirebaseDatabase.podspec @@ -38,7 +38,6 @@ Simplify your iOS development, grow your user base, and monetize more effectivel base_dir + 'third_party/Wrap-leveldb/APLevelDB.mm', 'FirebaseDatabase/Swift/Sources/**/*.swift', 'FirebaseAuth/Interop/**/*.h', - 'FirebaseCore/Extension/*.h', ] s.public_header_files = base_dir + 'Public/FirebaseDatabase/*.h' s.libraries = ['c++', 'icucore'] @@ -48,6 +47,7 @@ Simplify your iOS development, grow your user base, and monetize more effectivel s.watchos.frameworks = 'CFNetwork', 'Security', 'WatchKit' s.dependency 'leveldb-library', '~> 1.22' s.dependency 'FirebaseCore', '11.5' + s.dependency 'FirebaseCoreExtension', '11.5' s.dependency 'FirebaseAppCheckInterop', '~> 11.0' s.dependency 'FirebaseSharedSwift', '~> 11.0' s.dependency 'GoogleUtilities/UserDefaults', '~> 8.0' diff --git a/FirebaseRemoteConfig/Tests/Unit/RCNInstanceIDTest.m b/FirebaseRemoteConfig/Tests/Unit/RCNInstanceIDTest.m index a5c35f15bf5..1799a97789c 100644 --- a/FirebaseRemoteConfig/Tests/Unit/RCNInstanceIDTest.m +++ b/FirebaseRemoteConfig/Tests/Unit/RCNInstanceIDTest.m @@ -27,10 +27,16 @@ #import "FirebaseRemoteConfig/Tests/Unit/RCNTestUtilities.h" #import -#import "FirebaseCore/Extension/FirebaseCoreInternal.h" #import "FirebaseInstallations/Source/Library/Private/FirebaseInstallationsInternal.h" @import FirebaseRemoteConfigInterop; +@import FirebaseCore; +@import FirebaseCoreExtension; +@import FirebaseCoreInternal; +#if SWIFT_PACKAGE +@import FirebaseCoreInternalObjC; +#endif + @interface RCNConfigFetch (ForTest) - (instancetype)initWithContent:(RCNConfigContent *)content DBManager:(RCNConfigDBManager *)DBManager diff --git a/Package.swift b/Package.swift index c74edf06a6e..18491eee55e 100644 --- a/Package.swift +++ b/Package.swift @@ -204,6 +204,8 @@ let package = Package( name: "CoreUnit", dependencies: [ "FirebaseCore", + "FirebaseCoreExtension", + "FirebaseCoreInternalObjC", "SharedTestUtilities", .product(name: "OCMock", package: "ocmock"), ], @@ -943,6 +945,7 @@ let package = Package( .target( name: "SharedTestUtilities", dependencies: ["FirebaseCore", + "FirebaseCoreInternalObjC", "FirebaseAppCheckInterop", "FirebaseAuthInterop", "FirebaseMessagingInterop", diff --git a/SharedTestUtilities/FIRComponentTestUtilities.h b/SharedTestUtilities/FIRComponentTestUtilities.h index 2c4beee12e9..150340da8eb 100644 --- a/SharedTestUtilities/FIRComponentTestUtilities.h +++ b/SharedTestUtilities/FIRComponentTestUtilities.h @@ -16,9 +16,10 @@ #import -@import FirebaseCoreInternal; #if SWIFT_PACKAGE @import FirebaseCoreInternalObjC; +#else +@import FirebaseCoreInternal; #endif NS_ASSUME_NONNULL_BEGIN diff --git a/scripts/check_imports.swift b/scripts/check_imports.swift index ee058f4b0e2..cddb043d515 100755 --- a/scripts/check_imports.swift +++ b/scripts/check_imports.swift @@ -121,6 +121,8 @@ private func checkFile(_ file: String, logger: ErrorLogger, inRepo repoURL: URL, } else if inSwiftPackage, line.starts(with: "#else") { inSwiftPackage = false inSwiftPackageElse = true + } else if inSwiftPackage, line.starts(with: "#endif") { + inSwiftPackage = false } else if inSwiftPackageElse, line.starts(with: "#endif") { inSwiftPackageElse = false } else if inSwiftPackage {