Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions AddNewPod.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ detailed instructions. Some Firebase specific guidance below:
* `s.deployment_target` - Ideally should include ios, osx, and tvos. See
[FirebaseCore.podspec](FirebaseCore.podspec) for the current Firebase minimum version settings.

* `s.static_framework` - By default, Firebase pods should be static frameworks.

* `s.dependency` - Dependencies on other Firebase pods and pods in this repo should specify a
version and allow minor version updates - like `s.dependency 'FirebaseCore', '~> 6.6'`. When
initially defined, choose the most recently released minor version of the dependency.
Expand Down
1 change: 0 additions & 1 deletion FirebaseABTesting.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Firebase Cloud Messaging and Firebase Remote Config in your app.
s.tvos.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

base_dir = "FirebaseABTesting/Sources/"
Expand Down
1 change: 0 additions & 1 deletion FirebaseAppDistribution.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ iOS SDK for App Distribution for Firebase.
s.ios.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

base_dir = "FirebaseAppDistribution/Sources/"
Expand Down
1 change: 0 additions & 1 deletion FirebaseAuth.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ supports email and password accounts, as well as several 3rd party authenticatio
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

source = 'FirebaseAuth/Sources/'
Expand Down
18 changes: 12 additions & 6 deletions FirebaseCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Firebase Core includes FIRApp and FIROptions which provide central configuration
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

s.source_files = [
Expand Down Expand Up @@ -54,20 +53,27 @@ Firebase Core includes FIRApp and FIROptions which provide central configuration
}
s.test_spec 'unit' do |unit_tests|
unit_tests.platforms = {:ios => '8.0', :osx => '10.11', :tvos => '10.0'}
unit_tests.source_files = 'FirebaseCore/Tests/Unit/**/*.[mh]'
unit_tests.source_files = [
'FirebaseCore/Tests/Unit/**/*.[mh]',
'SharedTestUtilities/FIROptionsMock.[mh]',
]
unit_tests.requires_app_host = true
unit_tests.dependency 'OCMock'
unit_tests.resources = 'FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist'
end

s.test_spec 'swift-unit' do |swift_unit_tests|
swift_unit_tests.platforms = {:ios => '8.0', :osx => '10.11', :tvos => '10.0'}
swift_unit_tests.source_files = 'FirebaseCore/Tests/SwiftUnit/**/*.swift',
'FirebaseCore/Tests/SwiftUnit/**/*.h',
'FirebaseCore/Tests/SwiftUnit/SwiftTestingUtilities/*'
swift_unit_tests.resources = 'FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist'
swift_unit_tests.source_files = [
'FirebaseCore/Tests/SwiftUnit/**/*.swift',
'FirebaseCore/Tests/SwiftUnit/**/*.h',
'FirebaseCore/Tests/SwiftUnit/SwiftTestingUtilities/*',
'SharedTestUtilities/FIROptionsMock.[mh]',
]
swift_unit_tests.pod_target_xcconfig = {
'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/FirebaseCore/Tests/SwiftUnit/FirebaseCore-unit-Bridging-Header.h'
}
swift_unit_tests.dependency 'OCMock'
swift_unit_tests.resources = 'FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist'
end
end
3 changes: 3 additions & 0 deletions FirebaseCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- [changed] Update minimum iOS version to iOS 10 except for Analytics which is now iOS 9. (#4847)
- [changed] Update minimum macOS version to 10.12.
- [added] Swift Package Manager support for Firebase Messaging. (#5641)
- [changed] The pods developed in this repo are no longer hard coded to be built as static
frameworks. Instead, their linkage will be controlled by the Podfile. Use the Podfile
option `use_frameworks! :linkage => :static` to get the Firebase 6.x linkage behavior. (#2022)

# Firebase 6.33.0
- [fixed] Swift Package Manager - Define system framework and system library dependencies. This
Expand Down
1 change: 1 addition & 0 deletions FirebaseCore/Tests/SwiftUnit/FirebaseAppTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ private extension Constants {
class FirebaseAppTests: XCTestCase {
override func setUp() {
super.setUp()
FIROptionsMock.mockFIROptions()
}

override func tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
#import "FirebaseCore/Tests/SwiftUnit/SwiftTestingUtilities/ExceptionCatcher.h"
#import "SharedTestUtilities/FIROptionsMock.h"
6 changes: 2 additions & 4 deletions FirebaseCore/Tests/Unit/FIRAppTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#import "FirebaseCore/Sources/Private/FIRAppInternal.h"
#import "FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h"
#import "FirebaseCore/Sources/Private/FIROptionsInternal.h"

#import "GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h"
#import "SharedTestUtilities/FIROptionsMock.h"

NSString *const kFIRTestAppName1 = @"test_app_name_1";
NSString *const kFIRTestAppName2 = @"test-app-name-2";
Expand Down Expand Up @@ -68,9 +68,7 @@ - (void)setUp {
_observerMock = OCMObserverMock();
_mockCoreDiagnosticsConnector = OCMClassMock([FIRCoreDiagnosticsConnector class]);

#if SWIFT_PACKAGE
[self mockFIROptions];
#endif
[FIROptionsMock mockFIROptions];

OCMStub(ClassMethod([self.mockCoreDiagnosticsConnector logCoreTelemetryWithOptions:[OCMArg any]]))
.andDo(^(NSInvocation *invocation){
Expand Down
1 change: 1 addition & 0 deletions FirebaseCore/Tests/Unit/FIRBundleUtilTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#import "FirebaseCore/Sources/FIRBundleUtil.h"
#import "GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h"
#import "SharedTestUtilities/FIROptionsMock.h"

static NSString *const kResultPath = @"resultPath";
static NSString *const kResourceName = @"resourceName";
Expand Down
2 changes: 1 addition & 1 deletion FirebaseCore/Tests/Unit/FIRComponentContainerTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#import "FirebaseCore/Sources/FIRComponentContainerInternal.h"
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"

#import "FirebaseCore/Tests/Unit/FIRTestComponents.h"
#import "SharedTestUtilities/FIROptionsMock.h"

/// Internally exposed methods and properties for testing.
@interface FIRComponentContainer (TestInternal)
Expand Down
13 changes: 4 additions & 9 deletions FirebaseCore/Tests/Unit/FIROptionsTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#import "FirebaseCore/Sources/FIRVersion.h"
#import "FirebaseCore/Sources/Private/FIRAppInternal.h"
#import "FirebaseCore/Sources/Private/FIROptionsInternal.h"
#import "SharedTestUtilities/FIROptionsMock.h"

extern NSString *const kFIRIsMeasurementEnabled;
extern NSString *const kFIRIsAnalyticsCollectionEnabled;
Expand All @@ -43,9 +44,7 @@ - (void)setUp {
}

- (void)testInit {
#if SWIFT_PACKAGE
[self mockFIROptions];
#endif
[FIROptionsMock mockFIROptions];
NSDictionary *optionsDictionary = [FIROptions defaultOptionsDictionary];
FIROptions *options = [[FIROptions alloc] initInternalWithOptionsDictionary:optionsDictionary];
[self assertOptionsMatchDefaults:options andProjectID:YES];
Expand Down Expand Up @@ -75,9 +74,7 @@ - (void)testDefaultOptionsDictionaryWithInvalidSourceFile {
}

- (void)testDefaultOptions {
#if SWIFT_PACKAGE
[self mockFIROptions];
#endif
[FIROptionsMock mockFIROptions];
FIROptions *options = [FIROptions defaultOptions];
[self assertOptionsMatchDefaults:options andProjectID:YES];
XCTAssertNil(options.deepLinkURLScheme);
Expand Down Expand Up @@ -242,9 +239,7 @@ - (void)testCopyingProperties {
}

- (void)testCopyWithZone {
#if SWIFT_PACKAGE
[self mockFIROptions];
#endif
[FIROptionsMock mockFIROptions];
// default options
FIROptions *options = [FIROptions defaultOptions];
options.deepLinkURLScheme = kDeepLinkURLScheme;
Expand Down
21 changes: 0 additions & 21 deletions FirebaseCore/Tests/Unit/FIRTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,8 @@
#import <XCTest/XCTest.h>
#import "OCMock.h"

NS_ASSUME_NONNULL_BEGIN

extern NSString *const kAPIKey;
extern NSString *const kCustomizedAPIKey;
extern NSString *const kClientID;
extern NSString *const kTrackingID;
extern NSString *const kGCMSenderID;
extern NSString *const kAndroidClientID;
extern NSString *const kGoogleAppID;
extern NSString *const kDatabaseURL;
extern NSString *const kStorageBucket;

extern NSString *const kDeepLinkURLScheme;
extern NSString *const kNewDeepLinkURLScheme;

extern NSString *const kBundleID;
extern NSString *const kProjectID;

/**
* Base test case for Firebase Core SDK tests.
*/
@interface FIRTestCase : XCTestCase
- (void)mockFIROptions;
@end

NS_ASSUME_NONNULL_END
46 changes: 0 additions & 46 deletions FirebaseCore/Tests/Unit/FIRTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@

#import "FirebaseCore/Tests/Unit/FIRTestCase.h"

#import "FirebaseCore/Sources/Private/FIROptionsInternal.h"

NSString *const kAndroidClientID = @"correct_android_client_id";
NSString *const kAPIKey = @"correct_api_key";
NSString *const kCustomizedAPIKey = @"customized_api_key";
NSString *const kClientID = @"correct_client_id";
NSString *const kTrackingID = @"correct_tracking_id";
NSString *const kGCMSenderID = @"correct_gcm_sender_id";
NSString *const kGoogleAppID = @"1:123:ios:123abc";
NSString *const kDatabaseURL = @"https://abc-xyz-123.firebaseio.com";
NSString *const kStorageBucket = @"project-id-123.storage.firebase.com";

NSString *const kDeepLinkURLScheme = @"comgoogledeeplinkurl";
NSString *const kNewDeepLinkURLScheme = @"newdeeplinkurlfortest";

NSString *const kBundleID = @"com.google.FirebaseSDKTests";
NSString *const kProjectID = @"abc-xyz-123";

@interface FIRTestCase ()

@end
Expand All @@ -42,34 +24,6 @@ - (void)setUp {
[super setUp];
}

// Swift Package manager does not allow a test project to override a bundle in an app (or library).
- (void)mockFIROptions {
// Keys for the strings in the plist file.
NSString *const kFIRAPIKey = @"API_KEY";
NSString *const kFIRTrackingID = @"TRACKING_ID";
NSString *const kFIRGoogleAppID = @"GOOGLE_APP_ID";
NSString *const kFIRClientID = @"CLIENT_ID";
NSString *const kFIRGCMSenderID = @"GCM_SENDER_ID";
NSString *const kFIRDatabaseURL = @"DATABASE_URL";
NSString *const kFIRStorageBucket = @"STORAGE_BUCKET";
NSString *const kFIRBundleID = @"BUNDLE_ID";
NSString *const kFIRProjectID = @"PROJECT_ID";

NSDictionary<NSString *, NSString *> *mockDictionary = @{
kFIRAPIKey : kAPIKey,
kFIRBundleID : kBundleID,
kFIRClientID : kClientID,
kFIRDatabaseURL : kDatabaseURL,
kFIRGCMSenderID : kGCMSenderID,
kFIRGoogleAppID : kGoogleAppID,
kFIRProjectID : kProjectID,
kFIRStorageBucket : kStorageBucket,
kFIRTrackingID : kTrackingID,
};
id optionsClassMock = OCMClassMock([FIROptions class]);
OCMStub([optionsClassMock defaultOptionsDictionary]).andReturn(mockDictionary);
}

- (void)tearDown {
[super tearDown];
}
Expand Down
1 change: 0 additions & 1 deletion FirebaseCoreDiagnostics.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ non-Cocoapod integration. This library also respects the Firebase global data co
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

header_search_paths = {
Expand Down
1 change: 0 additions & 1 deletion FirebaseCrashlytics.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Pod::Spec.new do |s|
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

s.source_files = [
Expand Down
25 changes: 16 additions & 9 deletions FirebaseDatabase.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Simplify your iOS development, grow your user base, and monetize more effectivel
s.tvos.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

base_dir = "FirebaseDatabase/Sources/"
Expand All @@ -44,19 +43,27 @@ Simplify your iOS development, grow your user base, and monetize more effectivel
}

s.test_spec 'unit' do |unit_tests|
unit_tests.source_files = 'FirebaseDatabase/Tests/Unit/*.[mh]',
'FirebaseDatabase/Tests/Helpers/*.[mh]',
'FirebaseDatabase/Tests/third_party/*.[mh]',
'SharedTestUtilities/FIRAuthInteropFake.[mh]',
'SharedTestUtilities/FIRComponentTestUtilities.h'
unit_tests.source_files = [
'FirebaseDatabase/Tests/Unit/*.[mh]',
'FirebaseDatabase/Tests/Helpers/*.[mh]',
'FirebaseDatabase/Tests/third_party/*.[mh]',
'SharedTestUtilities/FIRAuthInteropFake.[mh]',
'SharedTestUtilities/FIRComponentTestUtilities.h',
'SharedTestUtilities/FIROptionsMock.[mh]',
]
unit_tests.dependency 'OCMock'
unit_tests.resources = 'FirebaseDatabase/Tests/Resources/syncPointSpec.json',
'FirebaseDatabase/Tests/Resources/GoogleService-Info.plist'
end

s.test_spec 'integration' do |int_tests|
int_tests.source_files = 'FirebaseDatabase/Tests/Integration/*.[mh]',
'FirebaseDatabase/Tests/Helpers/*.[mh]',
'SharedTestUtilities/FIRAuthInteropFake.[mh]'
int_tests.source_files = [
'FirebaseDatabase/Tests/Integration/*.[mh]',
'FirebaseDatabase/Tests/Helpers/*.[mh]',
'SharedTestUtilities/FIRAuthInteropFake.[mh]',
'SharedTestUtilities/FIROptionsMock.[mh]',
]
int_tests.dependency 'OCMock'
int_tests.resources = 'FirebaseDatabase/Tests/Resources/GoogleService-Info.plist'
end
end
5 changes: 2 additions & 3 deletions FirebaseDatabase/Tests/Helpers/FTestBase.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
#import "FirebaseDatabase/Tests/Helpers/FIRTestAuthTokenProvider.h"
#import "FirebaseDatabase/Tests/Helpers/FTestAuthTokenGenerator.h"
#import "FirebaseDatabase/Tests/Helpers/FTestBase.h"
#import "SharedTestUtilities/FIROptionsMock.h"

@implementation FTestBase

+ (void)setUp {
static dispatch_once_t once;
dispatch_once(&once, ^{
#if !SWIFT_PACKAGE
// Disabled for now with SPM. configure is not needed for the unit tests.
[FIROptionsMock mockFIROptions];
[FIRApp configure];
#endif
});
}

Expand Down
1 change: 0 additions & 1 deletion FirebaseDynamicLinks.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Firebase Dynamic Links are deep links that enhance user experience and increase
s.ios.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

s.source_files = [
Expand Down
1 change: 0 additions & 1 deletion FirebaseFirestore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
s.tvos.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

s.source_files = [
Expand Down
1 change: 0 additions & 1 deletion FirebaseFirestoreSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
s.tvos.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

s.requires_arc = true
Expand Down
1 change: 0 additions & 1 deletion FirebaseFunctions.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Cloud Functions for Firebase.
s.tvos.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

s.source_files = [
Expand Down
1 change: 0 additions & 1 deletion FirebaseInAppMessaging.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ See more product details at https://firebase.google.com/products/in-app-messagin
s.ios.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

base_dir = "FirebaseInAppMessaging/"
Expand Down
Loading