diff --git a/FirebaseRemoteConfig.podspec b/FirebaseRemoteConfig.podspec index e5a94002b83..bfb81b3051b 100644 --- a/FirebaseRemoteConfig.podspec +++ b/FirebaseRemoteConfig.podspec @@ -40,7 +40,6 @@ app update. 'FirebaseABTesting/Sources/Private/*.h', 'FirebaseCore/Extension/*.h', 'FirebaseInstallations/Source/Library/Private/*.h', - 'FirebaseRemoteConfig/Swift/**/*.swift', ] s.public_header_files = base_dir + 'Public/FirebaseRemoteConfig/*.h' s.pod_target_xcconfig = { @@ -48,7 +47,6 @@ app update. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"' } s.dependency 'FirebaseABTesting', '~> 10.0' - s.dependency 'FirebaseSharedSwift', '~> 10.0' s.dependency 'FirebaseCore', '~> 10.0' s.dependency 'FirebaseInstallations', '~> 10.0' s.dependency 'GoogleUtilities/Environment', '~> 7.8' diff --git a/FirebaseRemoteConfig/Swift/SPMSwiftHeaderWorkaround.swift b/FirebaseRemoteConfig/Swift/SPMSwiftHeaderWorkaround.swift deleted file mode 100644 index b83a981606d..00000000000 --- a/FirebaseRemoteConfig/Swift/SPMSwiftHeaderWorkaround.swift +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#if SWIFT_PACKAGE - @_exported import FirebaseRemoteConfigInternal - - // This is a trick to force generate a `FirebaseRemoteConfig-Swift.h` header - // that re-exports `FirebaseRemoteConfigInternal` for Objective-C clients. It - // is important for the below code to reference a Remote Config symbol defined - // in Objective-C as that will import the symbol's module - // (`FirebaseRemoteConfigInternal`) in the generated header. This allows - // Objective-C clients to import Remote Config's Objective-C API using - // `@import FirebaseRemoteConfig;`. This API is not needed for Swift clients - // and is therefore unavailable in a Swift context. - @available(*, unavailable) - @objc public extension RemoteConfig { - static var __no_op: () -> Void { {} } - } -#endif // SWIFT_PACKAGE diff --git a/FirebaseRemoteConfigSwift.podspec b/FirebaseRemoteConfigSwift.podspec index 6a9dbd3e0b6..cf55b8d0bb2 100644 --- a/FirebaseRemoteConfigSwift.podspec +++ b/FirebaseRemoteConfigSwift.podspec @@ -39,6 +39,7 @@ app update. ] s.dependency 'FirebaseRemoteConfig', '~> 10.0' + s.dependency 'FirebaseSharedSwift', '~> 10.0' # Run Swift API tests on a real backend. s.test_spec 'swift-api-tests' do |swift_api| diff --git a/FirebaseRemoteConfig/Swift/Codable.swift b/FirebaseRemoteConfigSwift/Sources/Codable.swift similarity index 96% rename from FirebaseRemoteConfig/Swift/Codable.swift rename to FirebaseRemoteConfigSwift/Sources/Codable.swift index d2df8a90db0..193ebf17fe2 100644 --- a/FirebaseRemoteConfig/Swift/Codable.swift +++ b/FirebaseRemoteConfigSwift/Sources/Codable.swift @@ -15,9 +15,7 @@ */ import Foundation -#if SWIFT_PACKAGE - @_exported import FirebaseRemoteConfigInternal -#endif // SWIFT_PACKAGE +import FirebaseRemoteConfig import FirebaseSharedSwift public enum RemoteConfigValueCodableError: Error { diff --git a/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift b/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift deleted file mode 100644 index 75ad4156099..00000000000 --- a/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(ncooke3): Add warning that importing this extension is deprecated. - -// The `@_exported` is needed to prevent breaking clients that are using -// types prefixed with the `FirebaseRemoteConfigSwift` module name (e.g. -// `FirebaseRemoteConfigSwift.RemoteConfigValueCodableError`). -@_exported import FirebaseRemoteConfig diff --git a/FirebaseRemoteConfig/Swift/FirebaseRemoteConfigValueDecoderHelper.swift b/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigValueDecoderHelper.swift similarity index 94% rename from FirebaseRemoteConfig/Swift/FirebaseRemoteConfigValueDecoderHelper.swift rename to FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigValueDecoderHelper.swift index d0cea378995..2a7b79a135e 100644 --- a/FirebaseRemoteConfig/Swift/FirebaseRemoteConfigValueDecoderHelper.swift +++ b/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigValueDecoderHelper.swift @@ -15,9 +15,7 @@ */ import Foundation -#if SWIFT_PACKAGE - @_exported import FirebaseRemoteConfigInternal -#endif // SWIFT_PACKAGE +import FirebaseRemoteConfig import FirebaseSharedSwift /// Implement the FirebaseRemoteConfigValueDecoding protocol for the shared Firebase decoder to diff --git a/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigProperty.swift b/FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigProperty.swift similarity index 94% rename from FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigProperty.swift rename to FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigProperty.swift index 05d1df52303..0df0e71bac8 100644 --- a/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigProperty.swift +++ b/FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigProperty.swift @@ -14,10 +14,7 @@ * limitations under the License. */ -#if SWIFT_PACKAGE - @_exported import FirebaseRemoteConfigInternal -#endif // SWIFT_PACKAGE - +import FirebaseRemoteConfig import SwiftUI /// A property wrapper that listens to a Remote Config value. diff --git a/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift b/FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigValueObservable.swift similarity index 96% rename from FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift rename to FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigValueObservable.swift index cd20422d9e6..b35c1685883 100644 --- a/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift +++ b/FirebaseRemoteConfigSwift/Sources/PropertyWrapper/RemoteConfigValueObservable.swift @@ -14,9 +14,7 @@ * limitations under the License. */ -#if SWIFT_PACKAGE - @_exported import FirebaseRemoteConfigInternal -#endif // SWIFT_PACKAGE +import FirebaseRemoteConfig import FirebaseCore import SwiftUI diff --git a/FirebaseRemoteConfig/Swift/Value.swift b/FirebaseRemoteConfigSwift/Sources/Value.swift similarity index 94% rename from FirebaseRemoteConfig/Swift/Value.swift rename to FirebaseRemoteConfigSwift/Sources/Value.swift index 8a66eda8bc3..0e81056511d 100644 --- a/FirebaseRemoteConfig/Swift/Value.swift +++ b/FirebaseRemoteConfigSwift/Sources/Value.swift @@ -15,9 +15,7 @@ */ import Foundation -#if SWIFT_PACKAGE - @_exported import FirebaseRemoteConfigInternal -#endif // SWIFT_PACKAGE +import FirebaseRemoteConfig /// Implements subscript overloads to enable Remote Config values to be accessed /// in a type-safe way directly from the current config. diff --git a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Codable.swift b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Codable.swift index 5319cd5bcea..5ebf90dfe00 100644 --- a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Codable.swift +++ b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Codable.swift @@ -13,6 +13,7 @@ // limitations under the License. import FirebaseRemoteConfig +import FirebaseRemoteConfigSwift import XCTest diff --git a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperDefaultConfigsTests.swift b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperDefaultConfigsTests.swift index 5e5b304ebac..b636778d6a2 100644 --- a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperDefaultConfigsTests.swift +++ b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperDefaultConfigsTests.swift @@ -16,7 +16,7 @@ import FirebaseCore import FirebaseRemoteConfig - +import FirebaseRemoteConfigSwift import XCTest let ConfigKeyForThisTestOnly = "PropertyWrapperDefaultConfigsTestsKey" diff --git a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperTests.swift b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperTests.swift index f868be7f9c0..a7c4f86cd75 100644 --- a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperTests.swift +++ b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/PropertyWrapperTests.swift @@ -15,7 +15,7 @@ */ import FirebaseRemoteConfig - +import FirebaseRemoteConfigSwift import XCTest #if compiler(>=5.5.2) && canImport(_Concurrency) diff --git a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Value.swift b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Value.swift index a8afdf50fc9..ca483df22ca 100644 --- a/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Value.swift +++ b/FirebaseRemoteConfigSwift/Tests/SwiftAPI/Value.swift @@ -13,6 +13,7 @@ // limitations under the License. import FirebaseRemoteConfig +import FirebaseRemoteConfigSwift import XCTest diff --git a/Package.swift b/Package.swift index 98c8a54e866..bb5254c5b53 100644 --- a/Package.swift +++ b/Package.swift @@ -892,9 +892,7 @@ let package = Package( dependencies: [ "FirebaseCore", "FirebaseInstallations", - // TODO(ncooke3): Consider if this should import the merged module - // (`FirebaseRemoteConfig`). - "FirebaseRemoteConfigInternal", + "FirebaseRemoteConfig", "FirebaseSessions", .product(name: "GoogleDataTransport", package: "GoogleDataTransport"), .product(name: "GULEnvironment", package: "GoogleUtilities"), @@ -958,7 +956,7 @@ let package = Package( // MARK: - Firebase Remote Config .target( - name: "FirebaseRemoteConfigInternal", + name: "FirebaseRemoteConfig", dependencies: [ "FirebaseCore", "FirebaseABTesting", @@ -973,7 +971,7 @@ let package = Package( ), .testTarget( name: "RemoteConfigUnit", - dependencies: ["FirebaseRemoteConfigInternal", .product(name: "OCMock", package: "ocmock")], + dependencies: ["FirebaseRemoteConfig", .product(name: "OCMock", package: "ocmock")], path: "FirebaseRemoteConfig/Tests/Unit", exclude: [ // Need to be evaluated/ported to RC V2. @@ -992,24 +990,17 @@ let package = Package( .headerSearchPath("../../.."), ] ), - .target( - name: "FirebaseRemoteConfig", - dependencies: [ - "FirebaseRemoteConfigInternal", - "FirebaseSharedSwift", - ], - path: "FirebaseRemoteConfig/Swift" - ), .target( name: "FirebaseRemoteConfigSwift", dependencies: [ "FirebaseRemoteConfig", + "FirebaseSharedSwift", ], path: "FirebaseRemoteConfigSwift/Sources" ), .testTarget( name: "RemoteConfigFakeConsole", - dependencies: ["FirebaseRemoteConfig", + dependencies: ["FirebaseRemoteConfigSwift", "RemoteConfigFakeConsoleObjC"], path: "FirebaseRemoteConfigSwift/Tests", exclude: [