Skip to content
3 changes: 1 addition & 2 deletions .github/workflows/combine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ jobs:
- name: Install Credentials.swift
run: |
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.swift.gpg \
FirebaseStorage/Tests/SwiftIntegration/Credentials.swift "$plist_secret"
cp FirebaseStorage/Tests/SwiftIntegration/Credentials.swift FirebaseStorageSwift/Tests/Integration/
FirebaseStorageSwift/Tests/Integration/Credentials.swift "$plist_secret"
- name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh StorageCombine all)
93 changes: 31 additions & 62 deletions .github/workflows/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
runs-on: macos-11
strategy:
matrix:
pod: [Storage, StorageSwift]
steps:
- uses: actions/checkout@v2
- uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
Expand All @@ -43,10 +40,9 @@ jobs:
- name: Install Credentials.swift
run: |
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.swift.gpg \
FirebaseStorage/Tests/SwiftIntegration/Credentials.swift "$plist_secret"
cp FirebaseStorage/Tests/SwiftIntegration/Credentials.swift FirebaseStorageSwift/Tests/Integration/
FirebaseStorageSwift/Tests/Integration/Credentials.swift "$plist_secret"
- name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh ${{ matrix.pod }} all)
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Storage all)

spm:
# Don't run on private repo unless it is a PR.
Expand All @@ -59,14 +55,14 @@ jobs:
cache_key: ${{ matrix.os }}
- name: Initialize xcodebuild
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
- name: Objective-C Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh StorageUnit iOS spm
- name: Swift Build
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseStorageSwift-Beta iOS spmbuildonly
- name: Swift Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseStorageUnit iOS spm

spm-cron:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
# if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
runs-on: macos-11
strategy:
matrix:
Expand All @@ -80,8 +76,6 @@ jobs:
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh StorageUnit ${{ matrix.target }} spm
- name: Swift Build
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseStorageSwift-Beta ${{ matrix.target }} spmbuildonly

catalyst:
# Don't run on private repo unless it is a PR.
Expand All @@ -95,81 +89,56 @@ jobs:
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Setup project and Build for Catalyst
run: scripts/test_catalyst.sh FirebaseStorage test FirebaseStorage-Unit-unit
run: scripts/test_catalyst.sh FirebaseStorageObjC test FirebaseStorageObjC-Unit-unit

quickstart:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Setup quickstart
run: scripts/setup_quickstart.sh storage
- name: Install Secret GoogleService-Info.plist
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \
quickstart-ios/storage/GoogleService-Info.plist "$plist_secret"
- name: Test objc quickstart
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true)
- name: Test swift quickstart
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true swift)
# TODO: Restore Quickstart when ported for Firebase 9.
# quickstart:
# # Don't run on private repo unless it is a PR.
# if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
# env:
# plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
# signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
# runs-on: macos-11
# steps:
# - uses: actions/checkout@v2
# - name: Setup quickstart
# run: scripts/setup_quickstart.sh storage
# - name: Install Secret GoogleService-Info.plist
# run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \
# quickstart-ios/storage/GoogleService-Info.plist "$plist_secret"
# - name: Test objc quickstart
# run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true)
# - name: Test swift quickstart
# run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true swift)

pod-lib-lint:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
runs-on: macos-11

strategy:
matrix:
target: [ios, tvos, macos, watchos]
spec: [
'FirebaseStorage.podspec --test-specs=unit', # The integration tests need more set up.
'FirebaseStorageSwift.podspec --skip-tests' # No current unit tests.
]
podspec: [Storage, StorageObjC]
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Build and test
run: |
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.spec }} --platforms=${{ matrix.target }}
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb Firebase${{ matrix.podspec }}.podspec --test-specs=unit --platforms=${{ matrix.target }}

storage-cron-only:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
# if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
runs-on: macos-11
strategy:
matrix:
target: [ios, tvos, macos, watchos]
flags: [
'--use-static-frameworks --skip-tests '
]
podspec: [Storage, StorageObjC]
needs: pod-lib-lint
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: PodLibLint Storage Cron
run: |
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}

storageswift-cron-only:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
runs-on: macos-11
strategy:
matrix:
target: [ios, tvos, macos, watchos]
flags: [
'--use-static-frameworks --skip-tests'
]
needs: pod-lib-lint
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: PodLibLint Storage Cron
run: |
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorageSwift.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb Firebase${{ matrix.podspec }}.podspec --platforms=${{ matrix.target }} --use-static-frameworks --skip-tests
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ target 'CocoapodsIntegrationTest' do
pod 'FirebaseMessagingInterop', :path => '../'
pod 'FirebasePerformance', :path => '../'
pod 'FirebaseStorage', :path => '../'
pod 'FirebaseStorageObjC', :path => '../'
end

# Using the new speed-enhancing features available with CocoaPods 1.7+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Firebase
import FirebaseAnalyticsSwift
import FirebaseFirestoreSwift
import FirebaseInAppMessagingSwift
import FirebaseStorageSwift
import FirebaseStorage

class CoreExists: FirebaseApp {}
class AnalyticsExists: Analytics {}
Expand Down
2 changes: 1 addition & 1 deletion CoreOnly/Tests/FirebasePodTest/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ target 'FirebasePodTest' do
pod 'FirebasePerformance', :path => '../../../'
pod 'FirebaseRemoteConfig', :path => '../../../'
pod 'FirebaseStorage', :path => '../../../'
pod 'FirebaseStorageSwift', :path => '../../../'
pod 'FirebaseStorageObjC', :path => '../../../'

# Get dependent pods from the repo also
pod 'FirebaseAppCheckInterop', :path => '../../../'
Expand Down
5 changes: 5 additions & 0 deletions Example/watchOSSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ target 'SampleWatchAppWatchKitExtension' do
platform :watchos, '7.0'

pod 'FirebaseCore', :path => '../../'
pod 'FirebaseCoreInternal', :path => '../../'
pod 'FirebaseMessaging', :path => '../../'
pod 'FirebaseCoreExtension', :path => '../../'
pod 'FirebaseCoreInternal', :path => '../../'
pod 'FirebaseCoreDiagnostics', :path => '../../'
pod 'FirebaseInstallations', :path => '../../'
pod 'FirebaseStorage', :path => '../../'
pod 'FirebaseRemoteConfig', :path => '../../'
pod 'FirebaseABTesting', :path => '../../'
pod 'FirebaseDatabase', :path => '../../'
pod 'FirebaseAppCheckInterop', :path => '../../'
pod 'FirebaseAuthInterop', :path => '../../'

pod 'Firebase/Messaging', :path => '../../'
pod 'Firebase/Storage', :path => '../../'
pod 'FirebaseStorageObjC', :path => '../../'
pod 'Firebase/RemoteConfig', :path => '../../'
pod 'Firebase/ABTesting', :path => '../../'
pod 'Firebase/Database', :path => '../../'
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAppCheck/Interop/FIRAppCheckInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(AppCheckTokenHandlerInterop)
typedef void (^FIRAppCheckTokenHandlerInterop)(id<FIRAppCheckTokenResultInterop> tokenResult);

NS_SWIFT_NAME(AppCheckInterop) @protocol FIRAppCheckInterop<NSObject>
NS_SWIFT_NAME(AppCheckInterop) @protocol FIRAppCheckInterop

/// Retrieve a cached or generate a new FAA Token. If forcingRefresh == YES always generates a new
/// token and updates the cache.
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAppCheckInterop.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseAppCheckInterop'
s.version = '8.12.0'
s.version = '8.15.0'
s.summary = 'Interfaces that allow other Firebase SDKs to use AppCheck functionality.'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAuthInterop.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseAuthInterop'
s.version = '8.12.0'
s.version = '8.15.0'
s.summary = 'Interfaces that allow other Firebase SDKs to use Auth functionality.'

s.description = <<-DESC
Expand Down
3 changes: 1 addition & 2 deletions FirebaseCombineSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ for internal testing only. It should not be published.
s.dependency 'FirebaseFunctions', '~> 8.12'
s.dependency 'FirebaseFirestore', '~> 8.0'
s.dependency 'FirebaseStorage', '~> 8.0'
s.dependency 'FirebaseStorageSwift', '~> 8.0-beta'

s.pod_target_xcconfig = {
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"',
Expand Down Expand Up @@ -94,7 +93,7 @@ for internal testing only. It should not be published.
}
int_tests.source_files = [
'FirebaseCombineSwift/Tests/Integration/Storage/StorageIntegration.swift',
'FirebaseStorage/Tests/SwiftIntegration/Credentials.swift'
'FirebaseStorageSwift/Tests/Integration/Credentials.swift'
]
int_tests.requires_app_host = true
# Resources are shared with FirebaseStorage's integration tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import Combine
import FirebaseStorage
import FirebaseStorageSwift
import FirebaseStorageObjC

@available(swift 5.0)
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import Combine
import FirebaseAuth
import FirebaseCore
import FirebaseStorage
import FirebaseStorageSwift
import FirebaseCombineSwift
import XCTest

Expand Down Expand Up @@ -262,7 +261,8 @@ class StorageIntegration: XCTestCase {
case .finished:
XCTFail("Unexpected success return from putData)")
case let .failure(error):
XCTAssertEqual((error as NSError).code, StorageErrorCode.unauthorized.rawValue)
XCTAssertEqual(String(describing: error),
"unauthorized(\"ios-opensource-samples.appspot.com\", \"ios/private/secretfile.txt\")")
expectation.fulfill()
}
}, receiveValue: { value in
Expand All @@ -289,7 +289,7 @@ class StorageIntegration: XCTestCase {
case .finished:
XCTFail("Unexpected success return from putFile)")
case let .failure(error):
XCTAssertEqual((error as NSError).domain, StorageErrorDomain)
XCTAssertEqual(String(describing: error), "unknown")
expectation.fulfill()
}
}, receiveValue: { value in
Expand Down Expand Up @@ -440,7 +440,7 @@ class StorageIntegration: XCTestCase {
case .finished:
XCTFail("Unexpected success return from getData)")
case let .failure(error):
XCTAssertEqual((error as NSError).domain, StorageErrorDomain)
XCTAssertEqual(String(describing: error), "downloadSizeExceeded(1048576, 1024)")
expectation.fulfill()
}
}, receiveValue: { value in
Expand Down
2 changes: 0 additions & 2 deletions FirebaseCombineSwift/Tests/Unit/FirebaseApp+Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ extension FirebaseApp {

static func appForStorageUnitTestsWithName(name: String) -> FirebaseApp {
let app = FirebaseApp(instanceWithName: name, options: appOptions())
let registrants = NSMutableSet(object: FIRStorageComponent.self)
app.container = FirebaseComponentContainer(app: app, registrants: registrants)
return app
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#import "SharedTestUtilities/FIRComponentTestUtilities.h"
#import "SharedTestUtilities/FIROptionsMock.h"

// Firebase Storage
#import "FirebaseStorage/Sources/FIRStorageComponent.h"

// Firebase Core
#import "FirebaseCore/Extension/FirebaseCoreInternal.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,9 @@ class StorageReferenceTests: XCTestCase {
// When
ref?.putFile(from: dummyFileURL, metadata: nil)
.sink { completion in
if case let .failure(error as NSError) = completion {
if case let .failure(error) = completion {
putFileExpectation.fulfill()

XCTAssertEqual(error.domain, StorageErrorDomain)
XCTAssertEqual(error.code, StorageErrorCode.unknown.rawValue)

let expectedDescription =
"File at URL: \(dummyFileURL.absoluteString) is not reachable. Ensure file URL is not" +
" a directory, symbolic link, or invalid url."
XCTAssertEqual(error.localizedDescription, expectedDescription)
XCTAssertEqual("unknown", String(describing: error))
}
} receiveValue: { metadata in
XCTFail("💥 result unexpected")
Expand Down
1 change: 1 addition & 0 deletions FirebaseCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Firebase Core includes FIRApp and FIROptions which provide central configuration
'FirebaseCore/Tests/SwiftUnit/**/*.swift',
'FirebaseCore/Tests/SwiftUnit/**/*.h',
'FirebaseCore/Tests/SwiftUnit/SwiftTestingUtilities/*',
'SharedTestUtilities/ExceptionCatcher.[mh]',
'SharedTestUtilities/FIROptionsMock.[mh]',
]
swift_unit_tests.pod_target_xcconfig = {
Expand Down
5 changes: 4 additions & 1 deletion FirebaseCore/Sources/FIRApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,10 @@ + (void)registerSwiftComponents {
SEL componentsToRegisterSEL = @selector(componentsToRegister);
// Dictionary of class names that conform to `FIRLibrary` and their user agents. These should only
// be SDKs that are written in Swift but still visible to ObjC.
NSDictionary<NSString *, NSString *> *swiftComponents = @{@"FIRFunctionsComponent" : @"fire-fun"};
NSDictionary<NSString *, NSString *> *swiftComponents = @{
@"FIRFunctionsComponent" : @"fire-fun",
@"FIRStorageComponent" : @"fire-str",
};
for (NSString *className in swiftComponents.allKeys) {
Class klass = NSClassFromString(className);
if (klass && [klass respondsToSelector:componentsToRegisterSEL]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
// limitations under the License.

#import "FirebaseCore/Extension/FirebaseCoreInternal.h"
#import "FirebaseCore/Tests/SwiftUnit/SwiftTestingUtilities/ExceptionCatcher.h"
#import "SharedTestUtilities/ExceptionCatcher.h"
#import "SharedTestUtilities/FIROptionsMock.h"
2 changes: 1 addition & 1 deletion FirebaseCoreExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseCoreExtension'
s.version = '8.12.0'
s.version = '8.15.0'
s.summary = 'Extended FirebaseCore APIs for Firebase product SDKs'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion FirebaseMessaging/Interop/FIRMessagingInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
NS_ASSUME_NONNULL_BEGIN

/** Connector for bridging communication between Firebase SDKs and FIRMessaging API. */
NS_SWIFT_NAME(MessagingInterop) @protocol FIRMessagingInterop<NSObject>
NS_SWIFT_NAME(MessagingInterop) @protocol FIRMessagingInterop

/**
* The FCM registration token is used to identify this device so that FCM can send notifications to
Expand Down
2 changes: 1 addition & 1 deletion FirebaseMessagingInterop.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseMessagingInterop'
s.version = '8.12.0'
s.version = '8.15.0'
s.summary = 'Interfaces that allow other Firebase SDKs to use Messaging functionality.'

s.description = <<-DESC
Expand Down
Loading