Skip to content

Commit 85f4f03

Browse files
authored
[Config] Consolidate Config and ConfigSwift (#11808)
1 parent 2ee43e0 commit 85f4f03

18 files changed

+106
-18
lines changed

.github/workflows/remoteconfig.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
strategy:
6161
matrix:
6262
target: [ios, tvos, macos, watchos]
63-
podspec: [FirebaseRemoteConfig.podspec, FirebaseRemoteConfigSwift.podspec --skip-tests]
63+
podspec: [FirebaseRemoteConfig.podspec, FirebaseRemoteConfigSwift.podspec --allow-warnings --skip-tests]
6464
steps:
6565
- uses: actions/checkout@v3
6666
- uses: ruby/setup-ruby@v1

FirebaseRemoteConfig.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ app update.
4040
'FirebaseABTesting/Sources/Private/*.h',
4141
'FirebaseCore/Extension/*.h',
4242
'FirebaseInstallations/Source/Library/Private/*.h',
43+
'FirebaseRemoteConfig/Swift/**/*.swift',
4344
]
4445
s.public_header_files = base_dir + 'Public/FirebaseRemoteConfig/*.h'
4546
s.pod_target_xcconfig = {
4647
'GCC_C_LANGUAGE_STANDARD' => 'c99',
4748
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"'
4849
}
4950
s.dependency 'FirebaseABTesting', '~> 10.0'
51+
s.dependency 'FirebaseSharedSwift', '~> 10.0'
5052
s.dependency 'FirebaseCore', '~> 10.0'
5153
s.dependency 'FirebaseInstallations', '~> 10.0'
5254
s.dependency 'GoogleUtilities/Environment', '~> 7.8'

FirebaseRemoteConfig/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Unreleased
2+
- [feature] The `FirebaseRemoteConfig` module now contains Firebase Remote
3+
Config's Swift-only APIs that were previously only available via the
4+
`FirebaseRemoteConfigSwift` extension SDK. See the
5+
`FirebaseRemoteConfigSwift` release note from this release for more details.
6+
17
# 10.12.0
28
- [fixed] Fix issue of real-time listeners not being properly removed. (#11458)
39
- [fixed] Fix real-time fetches not being able to fetch the latest template due to an in-progress fetch. (#11465)

FirebaseRemoteConfigSwift/Sources/Codable.swift renamed to FirebaseRemoteConfig/Swift/Codable.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616

1717
import Foundation
18-
import FirebaseRemoteConfig
18+
#if SWIFT_PACKAGE
19+
@_exported import FirebaseRemoteConfigInternal
20+
#endif // SWIFT_PACKAGE
1921
import FirebaseSharedSwift
2022

2123
public enum RemoteConfigValueCodableError: Error {

FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigValueDecoderHelper.swift renamed to FirebaseRemoteConfig/Swift/FirebaseRemoteConfigValueDecoderHelper.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616

1717
import Foundation
18-
import FirebaseRemoteConfig
18+
#if SWIFT_PACKAGE
19+
@_exported import FirebaseRemoteConfigInternal
20+
#endif // SWIFT_PACKAGE
1921
import FirebaseSharedSwift
2022

2123
/// Implement the FirebaseRemoteConfigValueDecoding protocol for the shared Firebase decoder to

FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigProperty.swift renamed to FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigProperty.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
import FirebaseRemoteConfig
17+
#if SWIFT_PACKAGE
18+
@_exported import FirebaseRemoteConfigInternal
19+
#endif // SWIFT_PACKAGE
20+
1821
import SwiftUI
1922

2023
/// A property wrapper that listens to a Remote Config value.

FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigValueObservable.swift renamed to FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import FirebaseRemoteConfig
17+
#if SWIFT_PACKAGE
18+
@_exported import FirebaseRemoteConfigInternal
19+
#endif // SWIFT_PACKAGE
1820
import FirebaseCore
1921
import SwiftUI
2022

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#if SWIFT_PACKAGE
16+
@_exported import FirebaseRemoteConfigInternal
17+
18+
// This is a trick to force generate a `FirebaseRemoteConfig-Swift.h` header
19+
// that re-exports `FirebaseRemoteConfigInternal` for Objective-C clients. It
20+
// is important for the below code to reference a Remote Config symbol defined
21+
// in Objective-C as that will import the symbol's module
22+
// (`FirebaseRemoteConfigInternal`) in the generated header. This allows
23+
// Objective-C clients to import Remote Config's Objective-C API using
24+
// `@import FirebaseRemoteConfig;`. This API is not needed for Swift clients
25+
// and is therefore unavailable in a Swift context.
26+
@available(*, unavailable)
27+
@objc public extension RemoteConfig {
28+
static var __no_op: () -> Void { {} }
29+
}
30+
#endif // SWIFT_PACKAGE

FirebaseRemoteConfigSwift/Sources/Value.swift renamed to FirebaseRemoteConfig/Swift/Value.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616

1717
import Foundation
18-
import FirebaseRemoteConfig
18+
#if SWIFT_PACKAGE
19+
@_exported import FirebaseRemoteConfigInternal
20+
#endif // SWIFT_PACKAGE
1921

2022
/// Implements subscript overloads to enable Remote Config values to be accessed
2123
/// in a type-safe way directly from the current config.

FirebaseRemoteConfigSwift.podspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ app update.
3939
]
4040

4141
s.dependency 'FirebaseCore', '~> 10.0'
42-
s.dependency 'FirebaseRemoteConfig', '~> 10.0'
43-
s.dependency 'FirebaseSharedSwift', '~> 10.0'
42+
s.dependency 'FirebaseRemoteConfig', '~> 10.17'
4443

4544
# Run Swift API tests on a real backend.
4645
s.test_spec 'swift-api-tests' do |swift_api|

0 commit comments

Comments
 (0)