From 299de31714f88c29e8124e9c19090085c41ed575 Mon Sep 17 00:00:00 2001 From: cherylEnkidu Date: Tue, 5 Nov 2024 12:26:40 -0500 Subject: [PATCH] simplify cocoapods --- FirebaseCombineSwift.podspec | 4 +- FirebaseFirestore.podspec | 1 - FirebaseFirestoreCpp.podspec | 65 ------------------- FirebaseFirestoreInternal.podspec | 6 +- .../Swift/Source/SwiftAPI/SwiftCppAPI.swift | 4 +- 5 files changed, 11 insertions(+), 69 deletions(-) delete mode 100644 FirebaseFirestoreCpp.podspec diff --git a/FirebaseCombineSwift.podspec b/FirebaseCombineSwift.podspec index a181b9b1a42..18b73a4dc7e 100644 --- a/FirebaseCombineSwift.podspec +++ b/FirebaseCombineSwift.podspec @@ -59,6 +59,7 @@ for internal testing only. It should not be published. s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"', + 'SWIFT_OBJC_INTEROP_MODE' => 'objcxx', } s.test_spec 'unit' do |unit_tests| @@ -81,7 +82,8 @@ for internal testing only. It should not be published. unit_tests.exclude_files = 'FirebaseCombineSwift/Tests/Unit/**/*Template.swift' unit_tests.requires_app_host = true unit_tests.pod_target_xcconfig = { - 'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/FirebaseCombineSwift/Tests/Unit/FirebaseCombine-unit-Bridging-Header.h' + 'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/FirebaseCombineSwift/Tests/Unit/FirebaseCombine-unit-Bridging-Header.h', + 'SWIFT_OBJC_INTEROP_MODE' => 'objcxx', } unit_tests.dependency 'OCMock' unit_tests.dependency 'FirebaseAuthTestingSupport' diff --git a/FirebaseFirestore.podspec b/FirebaseFirestore.podspec index 8ea3479bdc1..2934bda631a 100644 --- a/FirebaseFirestore.podspec +++ b/FirebaseFirestore.podspec @@ -44,7 +44,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling, s.dependency 'FirebaseCore', '11.5' s.dependency 'FirebaseCoreExtension', '11.5' s.dependency 'FirebaseFirestoreInternal', '11.5.0' - s.dependency 'FirebaseFirestoreCpp', '11.5.0' s.dependency 'FirebaseSharedSwift', '~> 11.0' end diff --git a/FirebaseFirestoreCpp.podspec b/FirebaseFirestoreCpp.podspec deleted file mode 100644 index 97fd1b5c9cd..00000000000 --- a/FirebaseFirestoreCpp.podspec +++ /dev/null @@ -1,65 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'FirebaseFirestoreCpp' - s.version = '11.5.0' - s.summary = 'Google Cloud Firestore' - - s.description = <<-DESC -Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. - DESC - - s.homepage = 'https://developers.google.com/' - s.license = { :type => 'Apache-2.0', :file => 'Firestore/LICENSE' } - s.authors = 'Google, Inc.' - - s.source = { - :git => 'https://github.com/firebase/firebase-ios-sdk.git', - :tag => 'CocoaPods-' + s.version.to_s - } - - s.ios.deployment_target = '13.0' - s.osx.deployment_target = '10.15' - s.tvos.deployment_target = '13.0' - - s.swift_version = '5.9' - - s.cocoapods_version = '>= 1.12.0' - s.prefix_header_file = false - - s.public_header_files = 'Firestore/core/swift/include/*.h' - - s.source_files = [ - 'Firestore/core/swift/**/*.{cc,h}' - ] - - abseil_version = '~> 1.20240116.1' - s.dependency 'abseil/algorithm', abseil_version - s.dependency 'abseil/base', abseil_version - s.dependency 'abseil/container/flat_hash_map', abseil_version - s.dependency 'abseil/memory', abseil_version - s.dependency 'abseil/meta', abseil_version - s.dependency 'abseil/strings/strings', abseil_version - s.dependency 'abseil/time', abseil_version - s.dependency 'abseil/types', abseil_version - - s.ios.frameworks = 'SystemConfiguration', 'UIKit' - s.osx.frameworks = 'SystemConfiguration' - s.tvos.frameworks = 'SystemConfiguration', 'UIKit' - - s.library = 'c++' - s.pod_target_xcconfig = { - 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14', - 'CLANG_CXX_LIBRARY' => 'libc++', - 'GCC_C_LANGUAGE_STANDARD' => 'c99', - 'GCC_PREPROCESSOR_DEFINITIONS' => - "FIRFirestore_VERSION=#{s.version} " + - # The nanopb pod sets these defs, so we must too. (We *do* require 16bit - # (or larger) fields, so we'd have to set at least PB_FIELD_16BIT - # anyways.) - 'PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1', - 'HEADER_SEARCH_PATHS' => - '"${PODS_TARGET_SRCROOT}" ' + - '"${PODS_TARGET_SRCROOT}/Firestore/core/swift" ' - } - - s.compiler_flags = '$(inherited) -Wreorder -Werror=reorder -Wno-comma' -end diff --git a/FirebaseFirestoreInternal.podspec b/FirebaseFirestoreInternal.podspec index 33a61dbca85..aee3a95f308 100644 --- a/FirebaseFirestoreInternal.podspec +++ b/FirebaseFirestoreInternal.podspec @@ -28,7 +28,10 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling, # Header files that constitute the interface to this module. Only Objective-C # headers belong here, since FirebaseFirestore is primarily an Objective-C # framework. - s.public_header_files = 'Firestore/Source/Public/FirebaseFirestore/*.h' + s.public_header_files = [ + 'Firestore/Source/Public/FirebaseFirestore/*.h', + 'Firestore/core/swift/include/*.h' + ] # source_files contains most of the header and source files for the project. # This includes files named in `public_header_files`. @@ -52,6 +55,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling, 'Firestore/core/include/**/*.{cc,mm}', 'Firestore/core/src/**/*.{cc,mm}', 'FirebaseAuth/Interop/**/*.h', + 'Firestore/core/swift/**/*.{cc,h}', ] # Internal headers that aren't necessarily globally unique. Most C++ internal diff --git a/Firestore/Swift/Source/SwiftAPI/SwiftCppAPI.swift b/Firestore/Swift/Source/SwiftAPI/SwiftCppAPI.swift index 4b2db92536c..aaafb30ef3d 100644 --- a/Firestore/Swift/Source/SwiftAPI/SwiftCppAPI.swift +++ b/Firestore/Swift/Source/SwiftAPI/SwiftCppAPI.swift @@ -14,7 +14,9 @@ * limitations under the License. */ -import FirebaseFirestoreCpp +#if SWIFT_PACKAGE + @_exported import FirebaseFirestoreCpp +#endif // SWIFT_PACKAGE public class SwiftCppWrapper { public init(_ value: String) {