From 38eafc0490fa9d698685911fd950e9ebf3357eb0 Mon Sep 17 00:00:00 2001 From: fummicc1 Date: Sun, 24 Nov 2024 21:17:25 +0900 Subject: [PATCH 01/10] Update Firebase version and add contains filter --- .swiftpm/EasyFirebase-Package.xctestplan | 31 +++ ...xcscheme => EasyFirebase-Package.xcscheme} | 61 +++-- ...uth.xcscheme => EasyFirebaseAuth.xcscheme} | 24 +- ...cscheme => EasyFirebaseFirestore.xcscheme} | 34 +-- .../xcschemes/EasyFirebaseStorage.xcscheme | 67 +++++ .../EasyFirebaseSwift-Package.xcscheme | 199 --------------- Examples/Example/FirestoreExample/Model.swift | 1 - .../BoardApplication/Message.swift | 1 - FirestoreClient.md | 3 +- Package.resolved | 241 +++++++++--------- Package.swift | 6 +- Sources/Auth/AppleAuthClient.swift | 2 +- Sources/Auth/FirebaseAuthClient.swift | 6 +- Sources/Firestore/FirestoreClient.swift | 48 ++-- .../FirestoreClientTests.swift | 1 - 15 files changed, 322 insertions(+), 403 deletions(-) create mode 100644 .swiftpm/EasyFirebase-Package.xctestplan rename .swiftpm/xcode/xcshareddata/xcschemes/{EasyFirebaseSwiftStorage.xcscheme => EasyFirebase-Package.xcscheme} (56%) rename .swiftpm/xcode/xcshareddata/xcschemes/{EasyFirebaseSwiftAuth.xcscheme => EasyFirebaseAuth.xcscheme} (78%) rename .swiftpm/xcode/xcshareddata/xcschemes/{EasyFirebaseSwiftFirestore.xcscheme => EasyFirebaseFirestore.xcscheme} (66%) create mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseStorage.xcscheme delete mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwift-Package.xcscheme diff --git a/.swiftpm/EasyFirebase-Package.xctestplan b/.swiftpm/EasyFirebase-Package.xctestplan new file mode 100644 index 0000000..6f7493e --- /dev/null +++ b/.swiftpm/EasyFirebase-Package.xctestplan @@ -0,0 +1,31 @@ +{ + "configurations" : [ + { + "id" : "D325B07B-16DE-4CCE-9A75-B696B8133B45", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:", + "identifier" : "EasyFirebaseStorageTests", + "name" : "EasyFirebaseStorageTests" + } + }, + { + "target" : { + "containerPath" : "container:", + "identifier" : "EasyFirebaseFirestoreTests", + "name" : "EasyFirebaseFirestoreTests" + } + } + ], + "version" : 1 +} diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftStorage.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebase-Package.xcscheme similarity index 56% rename from .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftStorage.xcscheme rename to .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebase-Package.xcscheme index bae0238..001a844 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftStorage.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebase-Package.xcscheme @@ -1,10 +1,11 @@ + LastUpgradeVersion = "1610" + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> @@ -28,9 +29,23 @@ buildForAnalyzing = "YES"> + + + + @@ -41,14 +56,30 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + @@ -74,9 +105,9 @@ diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftAuth.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseAuth.xcscheme similarity index 78% rename from .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftAuth.xcscheme rename to .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseAuth.xcscheme index 8e004b0..d4656c4 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftAuth.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseAuth.xcscheme @@ -1,10 +1,11 @@ + LastUpgradeVersion = "1610" + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> @@ -26,9 +27,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> - - + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftFirestore.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseFirestore.xcscheme similarity index 66% rename from .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftFirestore.xcscheme rename to .swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseFirestore.xcscheme index dddcbbe..b6af0cc 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwiftFirestore.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseFirestore.xcscheme @@ -1,10 +1,11 @@ + LastUpgradeVersion = "1610" + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> @@ -26,19 +27,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseStorage.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseStorage.xcscheme new file mode 100644 index 0000000..ea280f0 --- /dev/null +++ b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseStorage.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwift-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwift-Package.xcscheme deleted file mode 100644 index d871cd1..0000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/EasyFirebaseSwift-Package.xcscheme +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples/Example/FirestoreExample/Model.swift b/Examples/Example/FirestoreExample/Model.swift index bd5db11..e8d1fee 100644 --- a/Examples/Example/FirestoreExample/Model.swift +++ b/Examples/Example/FirestoreExample/Model.swift @@ -7,7 +7,6 @@ import EasyFirebaseFirestore import FirebaseFirestore -import FirebaseFirestoreSwift import Foundation struct Model: FirestoreModel { diff --git a/Examples/Practical/BoardApplication/BoardApplication/Message.swift b/Examples/Practical/BoardApplication/BoardApplication/Message.swift index 191d14b..f8ef669 100644 --- a/Examples/Practical/BoardApplication/BoardApplication/Message.swift +++ b/Examples/Practical/BoardApplication/BoardApplication/Message.swift @@ -1,6 +1,5 @@ import EasyFirebaseSwift import FirebaseFirestore -import FirebaseFirestoreSwift import Foundation struct Message: FirestoreModel { diff --git a/FirestoreClient.md b/FirestoreClient.md index 4fa4603..7cb5e67 100644 --- a/FirestoreClient.md +++ b/FirestoreClient.md @@ -9,7 +9,6 @@ First of all, create Model layer inheriting `FirestoreModel` protocol. ```swift import EasyFirebaseSwift -import FirebaseFirestoreSwift import FirebaseFirestore // Note: FirestoreModel inherits `Codable` Protocol @@ -20,7 +19,7 @@ struct Model: FirestoreModel { // collectionName corresponding to Firestore's CollectionName. static var collectionName: String = "models" - // NOTE: To use PropertyWrapper such as @DocumentID, @ServerTimestamp, please import FirebaseFirestoreSwift. + // NOTE: To use PropertyWrapper such as @DocumentID, @ServerTimestamp @DocumentID var ref: DocumentReference? diff --git a/Package.resolved b/Package.resolved index d9f84e6..c89e4ed 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,124 +1,123 @@ { - "object": { - "pins": [ - { - "package": "abseil", - "repositoryURL": "https://github.com/google/abseil-cpp-binary.git", - "state": { - "branch": null, - "revision": "748c7837511d0e6a507737353af268484e1745e2", - "version": "1.2024011601.1" - } - }, - { - "package": "AppCheck", - "repositoryURL": "https://github.com/google/app-check.git", - "state": { - "branch": null, - "revision": "076b241a625e25eac22f8849be256dfb960fcdfe", - "version": "10.19.1" - } - }, - { - "package": "Firebase", - "repositoryURL": "https://github.com/firebase/firebase-ios-sdk", - "state": { - "branch": null, - "revision": "9d17b500cd98d9a7009751ad62f802e152e97021", - "version": "10.26.0" - } - }, - { - "package": "GoogleAppMeasurement", - "repositoryURL": "https://github.com/google/GoogleAppMeasurement.git", - "state": { - "branch": null, - "revision": "16244d177c4e989f87b25e9db1012b382cfedc55", - "version": "10.25.0" - } - }, - { - "package": "GoogleDataTransport", - "repositoryURL": "https://github.com/google/GoogleDataTransport.git", - "state": { - "branch": null, - "revision": "a637d318ae7ae246b02d7305121275bc75ed5565", - "version": "9.4.0" - } - }, - { - "package": "GoogleUtilities", - "repositoryURL": "https://github.com/google/GoogleUtilities.git", - "state": { - "branch": null, - "revision": "57a1d307f42df690fdef2637f3e5b776da02aad6", - "version": "7.13.3" - } - }, - { - "package": "gRPC", - "repositoryURL": "https://github.com/google/grpc-binary.git", - "state": { - "branch": null, - "revision": "e9fad491d0673bdda7063a0341fb6b47a30c5359", - "version": "1.62.2" - } - }, - { - "package": "GTMSessionFetcher", - "repositoryURL": "https://github.com/google/gtm-session-fetcher.git", - "state": { - "branch": null, - "revision": "0382ca27f22fb3494cf657d8dc356dc282cd1193", - "version": "3.4.1" - } - }, - { - "package": "InteropForGoogle", - "repositoryURL": "https://github.com/google/interop-ios-for-google-sdks.git", - "state": { - "branch": null, - "revision": "2d12673670417654f08f5f90fdd62926dc3a2648", - "version": "100.0.0" - } - }, - { - "package": "leveldb", - "repositoryURL": "https://github.com/firebase/leveldb.git", - "state": { - "branch": null, - "revision": "a0bc79961d7be727d258d33d5a6b2f1023270ba1", - "version": "1.22.5" - } - }, - { - "package": "nanopb", - "repositoryURL": "https://github.com/firebase/nanopb.git", - "state": { - "branch": null, - "revision": "b7e1104502eca3a213b46303391ca4d3bc8ddec1", - "version": "2.30910.0" - } - }, - { - "package": "Promises", - "repositoryURL": "https://github.com/google/promises.git", - "state": { - "branch": null, - "revision": "540318ecedd63d883069ae7f1ed811a2df00b6ac", - "version": "2.4.0" - } - }, - { - "package": "SwiftProtobuf", - "repositoryURL": "https://github.com/apple/swift-protobuf.git", - "state": { - "branch": null, - "revision": "9f0c76544701845ad98716f3f6a774a892152bcb", - "version": "1.26.0" - } + "originHash" : "207bccc96cf2c88e6350c88ce46354196cc457fdf45bde70d7f9d18a7946fbd0", + "pins" : [ + { + "identity" : "abseil-cpp-binary", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/abseil-cpp-binary.git", + "state" : { + "revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27", + "version" : "1.2024011602.0" } - ] - }, - "version": 1 + }, + { + "identity" : "app-check", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/app-check.git", + "state" : { + "revision" : "61b85103a1aeed8218f17c794687781505fbbef5", + "version" : "11.2.0" + } + }, + { + "identity" : "firebase-ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/firebase-ios-sdk", + "state" : { + "revision" : "dbdfdc44bee8b8e4eaa5ec27eb12b9338f3f2bc1", + "version" : "11.5.0" + } + }, + { + "identity" : "googleappmeasurement", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleAppMeasurement.git", + "state" : { + "revision" : "4f234bcbdae841d7015258fbbf8e7743a39b8200", + "version" : "11.4.0" + } + }, + { + "identity" : "googledatatransport", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleDataTransport.git", + "state" : { + "revision" : "617af071af9aa1d6a091d59a202910ac482128f9", + "version" : "10.1.0" + } + }, + { + "identity" : "googleutilities", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleUtilities.git", + "state" : { + "revision" : "53156c7ec267db846e6b64c9f4c4e31ba4cf75eb", + "version" : "8.0.2" + } + }, + { + "identity" : "grpc-binary", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/grpc-binary.git", + "state" : { + "revision" : "f56d8fc3162de9a498377c7b6cea43431f4f5083", + "version" : "1.65.1" + } + }, + { + "identity" : "gtm-session-fetcher", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/gtm-session-fetcher.git", + "state" : { + "revision" : "5cfe5f090c982de9c58605d2a82a4fc77b774fbd", + "version" : "4.1.0" + } + }, + { + "identity" : "interop-ios-for-google-sdks", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/interop-ios-for-google-sdks.git", + "state" : { + "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", + "version" : "100.0.0" + } + }, + { + "identity" : "leveldb", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/leveldb.git", + "state" : { + "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1", + "version" : "1.22.5" + } + }, + { + "identity" : "nanopb", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/nanopb.git", + "state" : { + "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", + "version" : "2.30910.0" + } + }, + { + "identity" : "promises", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/promises.git", + "state" : { + "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", + "version" : "2.4.0" + } + }, + { + "identity" : "swift-protobuf", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-protobuf.git", + "state" : { + "revision" : "ebc7251dd5b37f627c93698e4374084d98409633", + "version" : "1.28.2" + } + } + ], + "version" : 3 } diff --git a/Package.swift b/Package.swift index 0fbeb75..eec7dbd 100644 --- a/Package.swift +++ b/Package.swift @@ -25,7 +25,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/firebase/firebase-ios-sdk", - .upToNextMajor(from: "10.24.0") + .upToNextMajor(from: "11.0.0") ) ], targets: [ @@ -43,10 +43,6 @@ let package = Package( name: "FirebaseFirestore", package: "firebase-ios-sdk" ), - .product( - name: "FirebaseFirestoreSwift", - package: "firebase-ios-sdk" - ), ], path: "Sources/Firestore" ), diff --git a/Sources/Auth/AppleAuthClient.swift b/Sources/Auth/AppleAuthClient.swift index 4970a24..b014aa8 100644 --- a/Sources/Auth/AppleAuthClient.swift +++ b/Sources/Auth/AppleAuthClient.swift @@ -199,7 +199,7 @@ extension AppleAuthClient { return } let firCredential = OAuthProvider.credential( - withProviderID: "apple.com", + providerID: .apple, idToken: idTokenString, rawNonce: nonce ) diff --git a/Sources/Auth/FirebaseAuthClient.swift b/Sources/Auth/FirebaseAuthClient.swift index 5591d35..d940a16 100644 --- a/Sources/Auth/FirebaseAuthClient.swift +++ b/Sources/Auth/FirebaseAuthClient.swift @@ -53,10 +53,10 @@ public class FirebaseAuthClient { internal func getAppleCredential( idToken token: String, - nonce: String? + nonce: String ) -> AuthCredential { let credential = OAuthProvider.credential( - withProviderID: "apple.com", + providerID: .apple, idToken: token, rawNonce: nonce ) @@ -71,7 +71,7 @@ public class FirebaseAuthClient { return data.user } - public func signInWithApple(idToken token: String, nonce: String?) async throws + public func signInWithApple(idToken token: String, nonce: String) async throws -> FirebaseAuth.User { let credential = getAppleCredential(idToken: token, nonce: nonce) diff --git a/Sources/Firestore/FirestoreClient.swift b/Sources/Firestore/FirestoreClient.swift index c4a32f8..e36affc 100644 --- a/Sources/Firestore/FirestoreClient.swift +++ b/Sources/Firestore/FirestoreClient.swift @@ -5,7 +5,6 @@ // import FirebaseFirestore -import FirebaseFirestoreSwift import Foundation public protocol FirestoreModel: Codable, Identifiable { @@ -36,7 +35,7 @@ public protocol SubCollectionModel: FirestoreModel { } public protocol FirestoreQueryFilter { - var fieldPath: String? { get } + var fieldPath: String { get } func build(type: Model.Type) -> Query func build(from: Query) -> Query @@ -57,18 +56,18 @@ public struct FirestoreQueryOrder { } public struct FirestoreRangeFilter: FirestoreQueryFilter { - public var fieldPath: String? + public var fieldPath: String public var minValue: Value private var maxValue: Value - public init(fieldPath: String? = nil, minValue: Value, maxValue: Value) { + public init(fieldPath: String, minValue: Value, maxValue: Value) { self.fieldPath = fieldPath self.minValue = minValue self.maxValue = maxValue } public func build(from: Query) -> Query { - guard let fieldPath = fieldPath, maxValue > minValue else { + guard maxValue > minValue else { return from } return @@ -79,7 +78,7 @@ public struct FirestoreRangeFilter: FirestoreQueryFilter { public func build(type: Model.Type) -> Query where Model: FirestoreModel { let from = Firestore.firestore().collection(type.collectionName) - guard let fieldPath = fieldPath, maxValue > minValue else { + guard maxValue > minValue else { return from } return @@ -89,46 +88,55 @@ public struct FirestoreRangeFilter: FirestoreQueryFilter { } } +public struct FirestoreInFilter: FirestoreQueryFilter { + public var fieldPath: String + public var values: [Any] + + public init(fieldPath: String, values: [Any]) { + self.fieldPath = fieldPath + self.values = values + } + + public func build(from: Query) -> Query { + from.whereField(fieldPath, in: values) + } + + public func build(type: Model.Type) -> Query where Model : FirestoreModel { + let from = Firestore.firestore().collection(type.collectionName) + return from.whereField(fieldPath, in: values) + } +} + public struct FirestoreEqualFilter: FirestoreQueryFilter { - public var fieldPath: String? + public var fieldPath: String public var value: Any? - public init(fieldPath: String?, value: Any?) { + public init(fieldPath: String, value: Any?) { self.fieldPath = fieldPath self.value = value } public func build(from: Query) -> Query { - - guard let fieldPath = fieldPath else { - return from - } return from.whereField(fieldPath, isEqualTo: value as Any) } public func build(type: Model.Type) -> Query where Model: FirestoreModel { let from = Firestore.firestore().collection(type.collectionName) - guard let fieldPath = fieldPath else { - return from - } return from.whereField(fieldPath, isEqualTo: value as Any) } } public struct FirestoreContainFilter: FirestoreQueryFilter { - public var fieldPath: String? + public var fieldPath: String public var value: Any - public init(fieldPath: String?, value: Any) { + public init(fieldPath: String, value: Any) { self.fieldPath = fieldPath self.value = value } public func build(from: Query) -> Query { - guard let fieldPath = fieldPath else { - return from - } return from.whereField(fieldPath, arrayContains: value) } diff --git a/Tests/EasyFirebaseFirestoreTests/FirestoreClientTests.swift b/Tests/EasyFirebaseFirestoreTests/FirestoreClientTests.swift index 9c229ca..e91a9b2 100644 --- a/Tests/EasyFirebaseFirestoreTests/FirestoreClientTests.swift +++ b/Tests/EasyFirebaseFirestoreTests/FirestoreClientTests.swift @@ -7,7 +7,6 @@ import Combine import FirebaseFirestore -import FirebaseFirestoreSwift import XCTest @testable import EasyFirebaseFirestore From 279a8a660b82b83acc1f24e64b5934ba74beb042 Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Wed, 10 Dec 2025 23:52:53 +0900 Subject: [PATCH 02/10] =?UTF-8?q?Firebase=20iOS=20SDK=E3=82=9212.6.0?= =?UTF-8?q?=E3=81=AB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Package.swiftの依存関係を11.0.0から12.0.0に変更 - Package.resolvedを更新して依存パッケージを最新バージョンに解決 - 主要な更新: - GoogleUtilities: 7.13.3 → 8.1.0 - gtm-session-fetcher: 3.4.1 → 5.0.0 - swift-protobuf: 1.26.0 → 1.33.3 - grpc-binary: 1.62.2 → 1.69.1 注: Swift 6.2.1カスタムツールチェインでは非互換性があるため、 xcrun swift buildでXcodeのデフォルトツールチェインを使用する必要があります。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .gitignore | 5 ++++- Package.resolved | 43 ++++++++++++++++++++++++++----------------- Package.swift | 2 +- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 9d4de2a..62efded 100644 --- a/.gitignore +++ b/.gitignore @@ -98,4 +98,7 @@ ui-debug.log # fvm .fvm/ -.index-build/ \ No newline at end of file +.index-build/ + +# Claude +.claude/settings.local.json \ No newline at end of file diff --git a/Package.resolved b/Package.resolved index c89e4ed..411f53a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "207bccc96cf2c88e6350c88ce46354196cc457fdf45bde70d7f9d18a7946fbd0", + "originHash" : "43bf4098ab937373aa474c8b794b5fcbc139262541033c03a2b10d9a8e2a5f7a", "pins" : [ { "identity" : "abseil-cpp-binary", "kind" : "remoteSourceControl", "location" : "https://github.com/google/abseil-cpp-binary.git", "state" : { - "revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27", - "version" : "1.2024011602.0" + "revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5", + "version" : "1.2024072200.0" } }, { @@ -24,8 +24,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk", "state" : { - "revision" : "dbdfdc44bee8b8e4eaa5ec27eb12b9338f3f2bc1", - "version" : "11.5.0" + "revision" : "087bb95235f676c1a37e928769a5b6645dcbd325", + "version" : "12.6.0" + } + }, + { + "identity" : "google-ads-on-device-conversion-ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk", + "state" : { + "revision" : "35b601a60fbbea2de3ea461f604deaaa4d8bbd0c", + "version" : "3.2.0" } }, { @@ -33,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "4f234bcbdae841d7015258fbbf8e7743a39b8200", - "version" : "11.4.0" + "revision" : "c2d59acf17a8ba7ed80a763593c67c9c7c006ad1", + "version" : "12.5.0" } }, { @@ -51,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "53156c7ec267db846e6b64c9f4c4e31ba4cf75eb", - "version" : "8.0.2" + "revision" : "60da361632d0de02786f709bdc0c4df340f7613e", + "version" : "8.1.0" } }, { @@ -60,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/grpc-binary.git", "state" : { - "revision" : "f56d8fc3162de9a498377c7b6cea43431f4f5083", - "version" : "1.65.1" + "revision" : "75b31c842f664a0f46a2e590a570e370249fd8f6", + "version" : "1.69.1" } }, { @@ -69,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/gtm-session-fetcher.git", "state" : { - "revision" : "5cfe5f090c982de9c58605d2a82a4fc77b774fbd", - "version" : "4.1.0" + "revision" : "fb7f2740b1570d2f7599c6bb9531bf4fad6974b7", + "version" : "5.0.0" } }, { @@ -78,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/interop-ios-for-google-sdks.git", "state" : { - "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", - "version" : "100.0.0" + "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe", + "version" : "101.0.0" } }, { @@ -114,8 +123,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "ebc7251dd5b37f627c93698e4374084d98409633", - "version" : "1.28.2" + "revision" : "c169a5744230951031770e27e475ff6eefe51f9d", + "version" : "1.33.3" } } ], diff --git a/Package.swift b/Package.swift index eec7dbd..3618db1 100644 --- a/Package.swift +++ b/Package.swift @@ -25,7 +25,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/firebase/firebase-ios-sdk", - .upToNextMajor(from: "11.0.0") + .upToNextMajor(from: "12.0.0") ) ], targets: [ From 865c3854b7993e983f76870cf5a93a8c6059ca27 Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 02:22:36 +0900 Subject: [PATCH 03/10] =?UTF-8?q?GitHub=20Actions=E3=81=AE=E3=82=A2?= =?UTF-8?q?=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=AB=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 非推奨となったactions/cache@v2の警告を解決するため、 GitHub Actionsで使用しているアクションを最新バージョンに更新。 変更内容: - practical_examples.yml: - actions/checkout: v2 → v4 - actions/cache: v2 → v4 - sources.yml: - actions/checkout: v3 → v4 - actions/setup-java: v3 → v4 これにより、2024年12月5日に発表されたactions/cache v1/v2の 廃止に関する警告が解決されます。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/practical_examples.yml | 4 ++-- .github/workflows/sources.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/practical_examples.yml b/.github/workflows/practical_examples.yml index 8b7c97d..1b6da80 100644 --- a/.github/workflows/practical_examples.yml +++ b/.github/workflows/practical_examples.yml @@ -22,12 +22,12 @@ jobs: working-directory: Examples/Practical/BoardApplication shell: bash steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: Cache SwiftPM - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: SourcePackages key: ${{ runner.os }}-spm-${{ hashFiles('*.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }} diff --git a/.github/workflows/sources.yml b/.github/workflows/sources.yml index 4d8a9ba..b50fc22 100644 --- a/.github/workflows/sources.yml +++ b/.github/workflows/sources.yml @@ -14,12 +14,12 @@ jobs: name: "Build Sources" runs-on: macos-14 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: Install Java17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" From 16bd0ee8a6a8ee3ee3a4feaaf12285e59a702c2d Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 03:25:08 +0900 Subject: [PATCH 04/10] =?UTF-8?q?Firebase=20Emulator=E3=81=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=82=92=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E3=83=BB?= =?UTF-8?q?CI=E4=B8=A1=E6=96=B9=E3=81=A7=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ローカル開発とCI環境の両方で使用できる統合スクリプトを作成し、 `firebase emulators:exec`を使用したシンプルで信頼性の高い実装に移行。 変更内容: - firebase/run_with_emulator.sh: 新しい統合スクリプトを追加 - Firebase CLIの自動インストール - エミュレータの自動セットアップと起動 - コマンド実行後の自動クリーンアップ - データの永続化機能(import/export) - .github/workflows/sources.yml: 新しいスクリプトを使用 - 手動のPID管理を廃止 - 待機スクリプトが不要に - killプロセスが不要に - firebase/README.md: 使い方のドキュメントを追加 - ローカル開発での使用方法 - スクリプトの機能説明 - メリットの解説 - Examples: Package.resolvedをFirebase 12.6.0に更新 メリット: - ローカル開発とCIで同じテスト環境を保証 - エミュレータのライフサイクル管理が完全自動化 - 異常終了時も確実にクリーンアップ - コードがシンプルで保守性が向上 - 開発者がすぐに使えるドキュメント完備 使い方: cd firebase ./run_with_emulator.sh "swift build && swift test" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/sources.yml | 14 +---- .../xcshareddata/swiftpm/Package.resolved | 43 +++++++++------- .../xcshareddata/swiftpm/Package.resolved | 43 +++++++++------- firebase/README.md | 51 +++++++++++++++++++ firebase/run_with_emulator.sh | 32 ++++++++++++ 5 files changed, 137 insertions(+), 46 deletions(-) create mode 100644 firebase/README.md create mode 100755 firebase/run_with_emulator.sh diff --git a/.github/workflows/sources.yml b/.github/workflows/sources.yml index b50fc22..5d2b100 100644 --- a/.github/workflows/sources.yml +++ b/.github/workflows/sources.yml @@ -25,18 +25,8 @@ jobs: java-version: "17" - name: Install xcpretty run: bundle install - - name: Setup Firebase Emulator + - name: Build and Test with Firebase Emulators working-directory: ./firebase - run: ./emulator_setup.sh & + run: ./run_with_emulator.sh "set -o pipefail && swift build && swift test" env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - - name: Wait firebase_emulator_setup - working-directory: ./firebase - run: ./wait_firebase_emulator_setup.sh - - name: Build and Test - run: | - set -o pipefail && \ - swift build && \ - swift test - - name: Kill firebase_emulator process - run: kill `cat /tmp/firebase_emulator_pid.pid` &>/dev/null diff --git a/Examples/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 84d6c90..5d34d85 100644 --- a/Examples/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "012ca0c5bc83f92a514b00387cb75910945effabdc7a099ca8b2a185bbe34d76", + "originHash" : "87cca1d694e3293b28dd3d40bedd931d967f8e36b35203980b314f18d9d3f51e", "pins" : [ { "identity" : "abseil-cpp-binary", "kind" : "remoteSourceControl", "location" : "https://github.com/google/abseil-cpp-binary.git", "state" : { - "revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27", - "version" : "1.2024011602.0" + "revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5", + "version" : "1.2024072200.0" } }, { @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/app-check.git", "state" : { - "revision" : "3b62f154d00019ae29a71e9738800bb6f18b236d", - "version" : "10.19.2" + "revision" : "61b85103a1aeed8218f17c794687781505fbbef5", + "version" : "11.2.0" } }, { @@ -24,8 +24,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk", "state" : { - "revision" : "eca84fd638116dd6adb633b5a3f31cc7befcbb7d", - "version" : "10.29.0" + "revision" : "087bb95235f676c1a37e928769a5b6645dcbd325", + "version" : "12.6.0" + } + }, + { + "identity" : "google-ads-on-device-conversion-ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk", + "state" : { + "revision" : "35b601a60fbbea2de3ea461f604deaaa4d8bbd0c", + "version" : "3.2.0" } }, { @@ -33,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "fe727587518729046fc1465625b9afd80b5ab361", - "version" : "10.28.0" + "revision" : "c2d59acf17a8ba7ed80a763593c67c9c7c006ad1", + "version" : "12.5.0" } }, { @@ -42,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleDataTransport.git", "state" : { - "revision" : "a637d318ae7ae246b02d7305121275bc75ed5565", - "version" : "9.4.0" + "revision" : "617af071af9aa1d6a091d59a202910ac482128f9", + "version" : "10.1.0" } }, { @@ -51,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6", - "version" : "7.13.3" + "revision" : "60da361632d0de02786f709bdc0c4df340f7613e", + "version" : "8.1.0" } }, { @@ -60,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/grpc-binary.git", "state" : { - "revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359", - "version" : "1.62.2" + "revision" : "75b31c842f664a0f46a2e590a570e370249fd8f6", + "version" : "1.69.1" } }, { @@ -78,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/interop-ios-for-google-sdks.git", "state" : { - "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", - "version" : "100.0.0" + "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe", + "version" : "101.0.0" } }, { diff --git a/Examples/Practical/BoardApplication/BoardApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/Practical/BoardApplication/BoardApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 84d6c90..5d34d85 100644 --- a/Examples/Practical/BoardApplication/BoardApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples/Practical/BoardApplication/BoardApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "012ca0c5bc83f92a514b00387cb75910945effabdc7a099ca8b2a185bbe34d76", + "originHash" : "87cca1d694e3293b28dd3d40bedd931d967f8e36b35203980b314f18d9d3f51e", "pins" : [ { "identity" : "abseil-cpp-binary", "kind" : "remoteSourceControl", "location" : "https://github.com/google/abseil-cpp-binary.git", "state" : { - "revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27", - "version" : "1.2024011602.0" + "revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5", + "version" : "1.2024072200.0" } }, { @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/app-check.git", "state" : { - "revision" : "3b62f154d00019ae29a71e9738800bb6f18b236d", - "version" : "10.19.2" + "revision" : "61b85103a1aeed8218f17c794687781505fbbef5", + "version" : "11.2.0" } }, { @@ -24,8 +24,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk", "state" : { - "revision" : "eca84fd638116dd6adb633b5a3f31cc7befcbb7d", - "version" : "10.29.0" + "revision" : "087bb95235f676c1a37e928769a5b6645dcbd325", + "version" : "12.6.0" + } + }, + { + "identity" : "google-ads-on-device-conversion-ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk", + "state" : { + "revision" : "35b601a60fbbea2de3ea461f604deaaa4d8bbd0c", + "version" : "3.2.0" } }, { @@ -33,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "fe727587518729046fc1465625b9afd80b5ab361", - "version" : "10.28.0" + "revision" : "c2d59acf17a8ba7ed80a763593c67c9c7c006ad1", + "version" : "12.5.0" } }, { @@ -42,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleDataTransport.git", "state" : { - "revision" : "a637d318ae7ae246b02d7305121275bc75ed5565", - "version" : "9.4.0" + "revision" : "617af071af9aa1d6a091d59a202910ac482128f9", + "version" : "10.1.0" } }, { @@ -51,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6", - "version" : "7.13.3" + "revision" : "60da361632d0de02786f709bdc0c4df340f7613e", + "version" : "8.1.0" } }, { @@ -60,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/grpc-binary.git", "state" : { - "revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359", - "version" : "1.62.2" + "revision" : "75b31c842f664a0f46a2e590a570e370249fd8f6", + "version" : "1.69.1" } }, { @@ -78,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/interop-ios-for-google-sdks.git", "state" : { - "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", - "version" : "100.0.0" + "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe", + "version" : "101.0.0" } }, { diff --git a/firebase/README.md b/firebase/README.md new file mode 100644 index 0000000..268a204 --- /dev/null +++ b/firebase/README.md @@ -0,0 +1,51 @@ +# Firebase Emulator Scripts + +このディレクトリには、Firebase Emulatorを使用してテストを実行するためのスクリプトが含まれています。 + +## run_with_emulator.sh + +Firebase EmulatorとともにSwiftのビルドとテストを実行するための統合スクリプトです。 + +### 使い方 + +```bash +# 基本的な使い方 +cd firebase +./run_with_emulator.sh "swift build && swift test" + +# ビルドのみ +./run_with_emulator.sh "swift build" + +# テストのみ +./run_with_emulator.sh "swift test" + +# カスタムコマンド +./run_with_emulator.sh "your custom command" +``` + +### 機能 + +- Firebase CLIの自動インストール(未インストールの場合) +- Firestore EmulatorとStorage Emulatorの自動セットアップ +- エミュレータの起動・コマンド実行・停止を自動管理 +- エミュレータデータの永続化(`./firebase/data`ディレクトリ) + +### メリット + +- **シンプル**: 1つのコマンドで全てを管理 +- **信頼性**: エミュレータのクリーンアップが自動化 +- **再現性**: データのインポート/エクスポート機能 +- **ローカル開発**: CI/CDと同じ環境でローカルテスト可能 + +## レガシースクリプト + +以下のスクリプトは後方互換性のために残されていますが、新しいコードでは`run_with_emulator.sh`の使用を推奨します。 + +- `emulator_setup.sh`: エミュレータの手動起動(バックグラウンド) +- `wait_firebase_emulator_setup.sh`: エミュレータ起動の待機 + +## GitHub Actions + +GitHub Actionsワークフローでも同じスクリプトが使用されており、ローカル環境とCI環境で同じテスト実行方法を保証します。 + +参照: [.github/workflows/sources.yml](../.github/workflows/sources.yml) diff --git a/firebase/run_with_emulator.sh b/firebase/run_with_emulator.sh new file mode 100755 index 0000000..714f29c --- /dev/null +++ b/firebase/run_with_emulator.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# stop when error +set -e +# for debug +set -x +# stop when pipefail +set -o pipefail + +# check whether firebase has been installed or not. +if ! command -v firebase &> /dev/null +then + echo "Firebase CLI is not installed. Installing..." + curl -sL https://firebase.tools | bash +fi + +# setup firebase emulator only for firestore and storage +firebase setup:emulators:firestore +firebase setup:emulators:storage + +# Run command with emulators +# Usage: ./run_with_emulator.sh "your command here" +# Example: ./run_with_emulator.sh "swift build && swift test" + +if [ -z "$1" ]; then + echo "Error: Please provide a command to run with emulators" + echo "Usage: $0 \"command to run\"" + exit 1 +fi + +cd .. +firebase emulators:exec "$1" --project=demo-test --import=./firebase/data --export-on-exit=./firebase/data From 9dac043d0d5464595772a00d0c3698606deda0c4 Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 12:52:49 +0900 Subject: [PATCH 05/10] test: set FirebaseOption apiKey --- Sources/TestCore/FirebaseTestHepler.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/TestCore/FirebaseTestHepler.swift b/Sources/TestCore/FirebaseTestHepler.swift index b1644b4..55fad4f 100644 --- a/Sources/TestCore/FirebaseTestHepler.swift +++ b/Sources/TestCore/FirebaseTestHepler.swift @@ -34,6 +34,7 @@ enum FirebaseTestHelper { gcmSenderID: "sender_id" ) options.projectID = "test-" + dateFormatter.string(from: Date()) + options.apiKey = "test-" + dateFormatter.string(from: Date()) FirebaseApp.configure(options: options) let settings = Firestore.firestore().settings let host = "127.0.0.1" From 7e0c71b021ad6668b4417ace14313e7a8223927a Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 13:03:40 +0900 Subject: [PATCH 06/10] =?UTF-8?q?CI:=20iPhone=2015=E3=81=A8iPhone=2016?= =?UTF-8?q?=E3=81=AE=E4=B8=A1=E6=96=B9=E3=81=A7=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E5=AE=9F=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit practical_examples.ymlをマトリックスビルドに変更し、 複数のiOSバージョンでの互換性を確保。 変更内容: - マトリックスビルド戦略を追加 - iPhone 15 (iOS 17.5) - iPhone 16 (iOS 18.2) - destination指定にOSバージョンを追加 - ビルドステップ名を動的に生成 メリット: - iOS 17とiOS 18の両方での動作確認 - より広範なデバイスサポートの保証 - 将来的な互換性問題の早期発見 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/practical_examples.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/practical_examples.yml b/.github/workflows/practical_examples.yml index 1b6da80..822ed58 100644 --- a/.github/workflows/practical_examples.yml +++ b/.github/workflows/practical_examples.yml @@ -17,6 +17,11 @@ jobs: test: name: "Test BoardApplication" runs-on: macos-14 + strategy: + matrix: + device: + - { name: "iPhone 15", os: "17.5" } + - { name: "iPhone 16", os: "18.2" } defaults: run: working-directory: Examples/Practical/BoardApplication @@ -35,10 +40,10 @@ jobs: - name: Install xcpretty run: bundle install working-directory: ./ - - name: Build + - name: Build on ${{ matrix.device.name }} (iOS ${{ matrix.device.os }}) run: | set -o pipefail && \ xcodebuild -scheme BoardApplication \ - build -destination "name=iPhone 15" \ + build -destination "platform=iOS Simulator,name=${{ matrix.device.name }},OS=${{ matrix.device.os }}" \ -clonedSourcePackagesDirPath SourcePackages \ | bundle exec xcpretty From cfa98c1cb715f9a74d090188584232ae47839547 Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 13:06:14 +0900 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20Firebase=20Emulator=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=E3=81=AEworking=20director?= =?UTF-8?q?y=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit firebase.jsonの場所を考慮してスクリプトを修正。 問題: - firebase emulators:execがfirebase.jsonを見つけられない - cd ..でプロジェクトルートに移動していたため 修正内容: - firebaseディレクトリから実行を維持 - コマンド内で"cd .. && command"を実行 - import/exportパスを相対パスに修正(./firebase/data → ./data) これにより、firebase.jsonを正しく読み込みつつ、 コマンドはプロジェクトルートで実行される。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- firebase/run_with_emulator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firebase/run_with_emulator.sh b/firebase/run_with_emulator.sh index 714f29c..9308b5f 100755 --- a/firebase/run_with_emulator.sh +++ b/firebase/run_with_emulator.sh @@ -28,5 +28,5 @@ if [ -z "$1" ]; then exit 1 fi -cd .. -firebase emulators:exec "$1" --project=demo-test --import=./firebase/data --export-on-exit=./firebase/data +# Run emulators from firebase directory and execute command in project root +firebase emulators:exec "cd .. && $1" --project=demo-test --import=./data --export-on-exit=./data From 27ed4487de5ddb9f424a11723e84f10ec5d9136d Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 13:31:15 +0900 Subject: [PATCH 08/10] =?UTF-8?q?CI:=20Firebase=20Emulator=E7=94=A8?= =?UTF-8?q?=E3=81=ABJava=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=9221=E3=81=AB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firebase CLI 15.0.0以降ではJava 21以上が必要となりました。 GitHub ActionsのJavaバージョンを17から21に更新しました。 Changes: - Java 17 → Java 21 in GitHub Actions - README.mdに要件セクションを追加 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/sources.yml | 4 ++-- firebase/README.md | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sources.yml b/.github/workflows/sources.yml index 5d2b100..9a8a756 100644 --- a/.github/workflows/sources.yml +++ b/.github/workflows/sources.yml @@ -18,11 +18,11 @@ jobs: - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - - name: Install Java17 + - name: Install Java21 uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "17" + java-version: "21" - name: Install xcpretty run: bundle install - name: Build and Test with Firebase Emulators diff --git a/firebase/README.md b/firebase/README.md index 268a204..77f924e 100644 --- a/firebase/README.md +++ b/firebase/README.md @@ -6,6 +6,10 @@ Firebase EmulatorとともにSwiftのビルドとテストを実行するための統合スクリプトです。 +### 要件 + +- Java 21以上(Firebase CLI 15.0.0以降で必要) + ### 使い方 ```bash From 1a55841e048280b0d38b54c5940d7f3a5e0fd4cb Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 13:35:45 +0900 Subject: [PATCH 09/10] fix: Example app's import error --- .../Practical/BoardApplication/BoardApplication/Message.swift | 2 +- .../Practical/BoardApplication/BoardApplication/Model.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/Practical/BoardApplication/BoardApplication/Message.swift b/Examples/Practical/BoardApplication/BoardApplication/Message.swift index f8ef669..ad4d5b4 100644 --- a/Examples/Practical/BoardApplication/BoardApplication/Message.swift +++ b/Examples/Practical/BoardApplication/BoardApplication/Message.swift @@ -1,4 +1,4 @@ -import EasyFirebaseSwift +import EasyFirebaseFirestore import FirebaseFirestore import Foundation diff --git a/Examples/Practical/BoardApplication/BoardApplication/Model.swift b/Examples/Practical/BoardApplication/BoardApplication/Model.swift index b02309d..08c8c67 100644 --- a/Examples/Practical/BoardApplication/BoardApplication/Model.swift +++ b/Examples/Practical/BoardApplication/BoardApplication/Model.swift @@ -1,5 +1,5 @@ import Combine -import EasyFirebaseSwift +import EasyFirebaseFirestore import Foundation @MainActor From 6757b70a81978d84cffe6331c5e922379b001b14 Mon Sep 17 00:00:00 2001 From: Fumiya Tanaka Date: Thu, 11 Dec 2025 13:53:40 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20Combine=E3=83=99=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=81=AEAPI=E3=82=92=E6=96=B0=E3=81=97=E3=81=84Swift=20Concurr?= =?UTF-8?q?ency=20API=E3=81=AB=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 削除されたCombine関係のAPI(FirestoreModelTypeAction, SnapshotInputParameter, Message.multiple)を、 新しいSwift ConcurrencyベースのAPIに置き換えました。 Changes: - import Combineを削除 - cancellablesをlistenerTaskに置き換え - FirestoreClient.listen()を使用してAsyncThrowingStreamで監視 - deinitでタスクをキャンセル 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../Example/Example.xcodeproj/project.pbxproj | 12 +++++----- .../BoardApplication/Model.swift | 22 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Examples/Example/Example.xcodeproj/project.pbxproj b/Examples/Example/Example.xcodeproj/project.pbxproj index f167868..d687f88 100644 --- a/Examples/Example/Example.xcodeproj/project.pbxproj +++ b/Examples/Example/Example.xcodeproj/project.pbxproj @@ -419,7 +419,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = S8WBNKMKYU; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = StorageExample/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -449,7 +449,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = S8WBNKMKYU; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = StorageExample/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -594,7 +594,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2X6AD4W323; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/FirestoreExample/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( @@ -615,7 +615,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2X6AD4W323; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/FirestoreExample/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( @@ -637,7 +637,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2X6AD4W323; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AuthExample/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -667,7 +667,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2X6AD4W323; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AuthExample/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; diff --git a/Examples/Practical/BoardApplication/BoardApplication/Model.swift b/Examples/Practical/BoardApplication/BoardApplication/Model.swift index 08c8c67..e554135 100644 --- a/Examples/Practical/BoardApplication/BoardApplication/Model.swift +++ b/Examples/Practical/BoardApplication/BoardApplication/Model.swift @@ -1,4 +1,3 @@ -import Combine import EasyFirebaseFirestore import Foundation @@ -9,18 +8,23 @@ class Model: ObservableObject { @Published var nickName: String = "" @Published var newMessageText: String = "" - private var cancellables: Set = [] + private var listenerTask: Task? private let firestoreClient: FirestoreClient = FirestoreClient() init() { - let action = FirestoreModelTypeAction - .snapshots(SnapshotInputParameter.Default()) - Message.multiple(for: action, client: firestoreClient) - .sink { _ in - } receiveValue: { messages in - self.list = messages + listenerTask = Task { + do { + for try await messages in await firestoreClient.listen() as AsyncThrowingStream<[Message], Error> { + self.list = messages + } + } catch { + print("Error listening to messages: \(error)") } - .store(in: &cancellables) + } + } + + deinit { + listenerTask?.cancel() } func create() async {