File tree Expand file tree Collapse file tree 8 files changed +68
-11
lines changed
FirebaseStorage/Tests/Unit Expand file tree Collapse file tree 8 files changed +68
-11
lines changed Original file line number Diff line number Diff line change 2222
2323NS_ASSUME_NONNULL_BEGIN
2424
25+ @interface FIRComponentContainer (Private)
26+
27+ // / Initializes a container for a given app. This should only be called by the app itself.
28+ - (instancetype )initWithApp : (FIRApp *)app
29+ isDefaultApp : (BOOL )isDefaultApp
30+ isAppForARCore : (BOOL )isAppForARCore ;
31+
32+ // / Retrieves an instance that conforms to the specified protocol. This will return `nil` if the
33+ // / protocol wasn't registered, or if the instance couldn't be instantiated for the provided app.
34+ - (nullable id )instanceForProtocol : (Protocol *)protocol
35+ NS_SWIFT_UNAVAILABLE(" Use `instance(for:)` from the FirebaseCoreExtension module instead." );
36+
37+ // / Instantiates all the components that have registered as "eager" after initialization.
38+ - (void )instantiateEagerComponents ;
39+
40+ // / Remove all of the cached instances stored and allow them to clean up after themselves.
41+ - (void )removeAllCachedInstances ;
42+
43+ // / Removes all the components. After calling this method no new instances will be created.
44+ - (void )removeAllComponents ;
45+
46+ // / Register a class to provide components for the interoperability system. The class should conform
47+ // / to `FIRComponentRegistrant` and provide an array of `FIRComponent` objects.
48+ + (void )registerAsComponentRegistrant : (Class <FIRLibrary>)klass ;
49+
50+ @end
51+
2552@interface FIRComponentContainer ()
2653
2754// / The dictionary of components that are registered for a particular app. The key is an `NSString`
Original file line number Diff line number Diff line change 1616
1717#import " FirebaseCore/InternalObjC/FIRComponentType.h"
1818
19- #import " FirebaseCore/InternalObjC/FIRComponentContainerInternal.h"
19+ #import " FirebaseCore/InternalObjC/FIRComponentContainer.h"
20+
21+ @interface FIRComponentContainer (InstanceForProtocol)
22+
23+ // / Retrieves an instance that conforms to the specified protocol. This will return `nil` if the
24+ // / protocol wasn't registered, or if the instance couldn't be instantiated for the provided app.
25+ - (nullable id )instanceForProtocol : (Protocol *)protocol
26+ NS_SWIFT_UNAVAILABLE(" Use `instance(for:)` from the FirebaseCoreExtension module instead." );
27+ @end
2028
2129@implementation FIRComponentType
2230
Original file line number Diff line number Diff line change 2828
2929#import " FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h"
3030
31+ @import FirebaseCoreInternal;
32+ #if SWIFT_PACKAGE
33+ @import FirebaseCoreInternalObjC;
34+ #endif
35+
3136#import " FirebaseCore/Sources/FIRAnalyticsConfiguration.h"
3237#import " FirebaseCore/Sources/FIRBundleUtil.h"
3338#import " FirebaseCore/Sources/FIRConfigurationInternal.h"
3439#import " FirebaseCore/Sources/FIRFirebaseUserAgent.h"
3540
3641#import " FirebaseCore/Extension/FIRAppInternal.h"
3742#import " FirebaseCore/Extension/FIRHeartbeatLogger.h"
43+ #import " FirebaseCore/Sources/FIRComponentContainerInternal.h"
3844#import " FirebaseCore/Sources/FIROptionsInternal.h"
3945#import " FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h"
4046#import " FirebaseCore/Sources/Public/FirebaseCore/FIRVersion.h"
4147
42- @import FirebaseCoreInternal;
43- #if SWIFT_PACKAGE
44- @import FirebaseCoreInternalObjC;
45- #endif
46-
4748#import < GoogleUtilities/GULAppEnvironmentUtil.h>
4849
4950#import < objc/runtime.h>
Original file line number Diff line number Diff line change 1515 */
1616#import < Foundation/Foundation.h>
1717
18- #import " FIRComponentContainer.h"
18+ @import FirebaseCoreInternal;
19+ #ifdef SWIFT_PACKAGE
20+ @import FirebaseCoreInternalObjC;
21+ #else
22+ @import FirebaseCoreInternal;
23+ #endif
1924
2025@class FIRApp;
2126@protocol FIRLibrary;
Original file line number Diff line number Diff line change 1616
1717#import " FirebaseCore/Extension/FIRAppInternal.h"
1818#import " FirebaseCore/InternalObjC/FIRComponentContainer.h"
19- #import " FirebaseCore/InternalObjC/FIRComponentContainerInternal.h"
2019#import " FirebaseCore/InternalObjC/FIRComponentType.h"
2120#import " FirebaseCore/Tests/Unit/FIRTestComponents.h"
2221#import " SharedTestUtilities/FIROptionsMock.h"
@@ -34,6 +33,16 @@ + (void)registerAsComponentRegistrant:(Class<FIRLibrary>)klass
3433- (instancetype )initWithApp : (FIRApp *)app
3534 isDefaultApp : (BOOL )isDefaultApp
3635 registrants : (NSMutableSet <Class> *)allRegistrants ;
36+
37+ // / Instantiates all the components that have registered as "eager" after initialization.
38+ - (void )instantiateEagerComponents ;
39+
40+ // / Remove all of the cached instances stored and allow them to clean up after themselves.
41+ - (void )removeAllCachedInstances ;
42+
43+ // / Removes all the components. After calling this method no new instances will be created.
44+ - (void )removeAllComponents ;
45+
3746@end
3847
3948@interface FIRComponentContainer (TestInternalImplementations)
Original file line number Diff line number Diff line change 1414
1515#import " FirebaseCore/Tests/Unit/FIRTestCase.h"
1616
17- #import " FirebaseCore/InternalObjC/FIRComponentContainerInternal.h"
1817#import " FirebaseCore/InternalObjC/FIRComponentType.h"
1918
2019#import " FirebaseCore/Tests/Unit/FIRTestComponents.h"
2120
21+ @interface FIRComponentContainer (Private)
22+
23+ // / Retrieves an instance that conforms to the specified protocol. This will return `nil` if the
24+ // / protocol wasn't registered, or if the instance couldn't be instantiated for the provided app.
25+ - (nullable id )instanceForProtocol : (Protocol *)protocol
26+ NS_SWIFT_UNAVAILABLE(" Use `instance(for:)` from the FirebaseCoreExtension module instead." );
27+
28+ @end
29+
2230@interface FIRComponentTypeTest : FIRTestCase
2331
2432@property (nonatomic , strong ) id componentContainerMock;
Original file line number Diff line number Diff line change 1616
1717#import " FirebaseCore/Extension/FIRAppInternal.h"
1818#import " FirebaseCore/InternalObjC/FIRComponentContainer.h"
19- #import " FirebaseCore/InternalObjC/FIRComponentContainerInternal.h"
2019#import " FirebaseCore/InternalObjC/FIRComponentType.h"
2120#import " FirebaseCore/Tests/Unit/FIRTestComponents.h"
2221
Original file line number Diff line number Diff line change 1515import Foundation
1616
1717import FirebaseCore
18- import FirebaseCoreExtension
18+ @ _implementationOnly import FirebaseCoreExtension
1919@testable import FirebaseStorage
2020
2121import FirebaseAppCheckInterop
You can’t perform that action at this time.
0 commit comments