Commit ea6be94
feat: add Swift Package Manager (SPM) support for iOS (#870)
* feat: add Swift Package Manager support for all ML Kit packages
This extends PR #870 to cover all ML Kit packages that need Swift Package Manager
support for Flutter 3.44+ iOS builds.
Packages with MLKit dependencies:
- google_mlkit_barcode_scanning: MLKitBarcodeScanning
- google_mlkit_digital_ink_recognition: MLKitDigitalInkRecognition
- google_mlkit_document_scanner: MLKitDocumentScanner
- google_mlkit_entity_extraction: MLKitEntityExtraction
- google_mlkit_face_detection: MLKitFaceDetection
- google_mlkit_face_mesh_detection: MLKitFaceMesh
- google_mlkit_image_labeling: MLKitImageLabeling, MLKitImageLabelingCommon
- google_mlkit_language_id: MLKitLanguageID
- google_mlkit_object_detection: MLKitObjectDetection
- google_mlkit_selfie_segmentation: MLKitSegmentationSelfie
- google_mlkit_smart_reply: MLKitSmartReply
- google_mlkit_text_recognition: MLKitTextRecognition
- google_mlkit_translation: MLKitTranslate
- google_mlkit_subject_segmentation: MLKitSegmentationSubject
GenAI packages (iOS stubs only) - no MLKit dependencies:
- google_mlkit_genai_image_description
- google_mlkit_genai_prompt
- google_mlkit_genai_proofreading
- google_mlkit_genai_rewriting
- google_mlkit_genai_speech_recognition
- google_mlkit_genai_summarization
All packages now support Swift Package Manager using d-date/google-mlkit-swiftpm
as the MLKit binary distribution.
Fixes issue #868
* feat: add missing Package.swift for google_mlkit_commons and google_mlkit_pose_detection
* fix: move Package.swift to correct Swift Package Manager path
Flutter expects Package.swift at ios/<package_name>/Package.swift, not ios/Package.swift.
Changes:
- Move all 22 Package.swift files to ios/<package_name>/ subdirectories
- Update path from 'Classes' to '../Classes' for correct relative path resolution
This fixes Swift Package Manager detection for all ML Kit plugins.
* fix: correct Swift Package Manager package reference name
Swift Package Manager uses the URL-derived package name, not the @objc product name.
Changed all package references from 'GoogleMLKitSwiftPM' to 'google-mlkit-swiftpm'.
Also fixed GenAI packages (empty dependencies) to have valid SPM format.1 parent 614ac2b commit ea6be94
25 files changed
Lines changed: 781 additions & 67 deletions
File tree
- packages
- example
- ios
- Flutter
- Runner.xcodeproj
- google_mlkit_barcode_scanning/ios/google_mlkit_barcode_scanning
- google_mlkit_commons/ios/google_mlkit_commons
- google_mlkit_digital_ink_recognition/ios/google_mlkit_digital_ink_recognition
- google_mlkit_document_scanner/ios/google_mlkit_document_scanner
- google_mlkit_entity_extraction/ios/google_mlkit_entity_extraction
- google_mlkit_face_detection/ios/google_mlkit_face_detection
- google_mlkit_face_mesh_detection/ios/google_mlkit_face_mesh_detection
- google_mlkit_genai_image_description/ios/google_mlkit_genai_image_description
- google_mlkit_genai_prompt/ios/google_mlkit_genai_prompt
- google_mlkit_genai_proofreading/ios/google_mlkit_genai_proofreading
- google_mlkit_genai_rewriting/ios/google_mlkit_genai_rewriting
- google_mlkit_genai_speech_recognition/ios/google_mlkit_genai_speech_recognition
- google_mlkit_genai_summarization/ios/google_mlkit_genai_summarization
- google_mlkit_image_labeling/ios/google_mlkit_image_labeling
- google_mlkit_language_id/ios/google_mlkit_language_id
- google_mlkit_object_detection/ios/google_mlkit_object_detection
- google_mlkit_pose_detection/ios/google_mlkit_pose_detection
- google_mlkit_selfie_segmentation/ios/google_mlkit_selfie_segmentation
- google_mlkit_smart_reply/ios/google_mlkit_smart_reply
- google_mlkit_subject_segmentation/ios/google_mlkit_subject_segmentation
- google_mlkit_text_recognition/ios/google_mlkit_text_recognition
- google_mlkit_translation/ios/google_mlkit_translation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
44 | | - | |
45 | | - | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
| |||
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
61 | | - | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
68 | 62 | | |
69 | 63 | | |
70 | 64 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 65 | | |
75 | 66 | | |
76 | 67 | | |
77 | 68 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 69 | | |
87 | 70 | | |
88 | 71 | | |
| |||
103 | 86 | | |
104 | 87 | | |
105 | 88 | | |
106 | | - | |
107 | 89 | | |
108 | 90 | | |
109 | 91 | | |
| |||
137 | 119 | | |
138 | 120 | | |
139 | 121 | | |
140 | | - | |
141 | 122 | | |
142 | 123 | | |
143 | 124 | | |
144 | 125 | | |
145 | 126 | | |
146 | 127 | | |
147 | 128 | | |
148 | | - | |
149 | 129 | | |
150 | 130 | | |
151 | 131 | | |
| |||
211 | 191 | | |
212 | 192 | | |
213 | 193 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | 194 | | |
232 | 195 | | |
233 | 196 | | |
| |||
244 | 207 | | |
245 | 208 | | |
246 | 209 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | 210 | | |
270 | 211 | | |
271 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
| 614 | + | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
| 617 | + | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
660 | 660 | | |
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments