diff --git a/packages/example/ios/Podfile b/packages/example/ios/Podfile index 9f0d4515..2f65a326 100644 --- a/packages/example/ios/Podfile +++ b/packages/example/ios/Podfile @@ -23,6 +23,7 @@ def flutter_root end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) +require File.expand_path('../../google_mlkit_commons/ios/scripts/apple_silicon_simulator', __dir__) flutter_ios_podfile_setup @@ -56,4 +57,6 @@ post_install do |installer| end end end + + mlkit_apple_silicon_simulator_patch(installer) end diff --git a/packages/example/ios/Podfile.lock b/packages/example/ios/Podfile.lock index 3d814d2b..c90136b2 100644 --- a/packages/example/ios/Podfile.lock +++ b/packages/example/ios/Podfile.lock @@ -483,6 +483,6 @@ SPEC CHECKSUMS: PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 SSZipArchive: 8a6ee5677c8e304bebc109e39cf0da91ccef22ea -PODFILE CHECKSUM: 810ea711de6d4d578877638350f293e7020676b9 +PODFILE CHECKSUM: df61d3916884bb4fa8c7ec2fdffdf0dd0d3cec36 COCOAPODS: 1.16.2 diff --git a/packages/google_mlkit_barcode_scanning/ios/Package.swift b/packages/google_mlkit_barcode_scanning/ios/Package.swift new file mode 100644 index 00000000..6f681160 --- /dev/null +++ b/packages/google_mlkit_barcode_scanning/ios/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_barcode_scanning. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_barcode_scanning", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_barcode_scanning", + targets: ["google_mlkit_barcode_scanning"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_barcode_scanning", + dependencies: [ + .product(name: "MLKitBarcodeScanning", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_commons/README.md b/packages/google_mlkit_commons/README.md index 46e77f5a..588084ff 100644 --- a/packages/google_mlkit_commons/README.md +++ b/packages/google_mlkit_commons/README.md @@ -77,6 +77,41 @@ end Notice that the minimum `IPHONEOS_DEPLOYMENT_TARGET` is 15.5, you can set it to something newer but not older. +#### Apple Silicon iOS Simulator (iOS 26+) + +Google's `GoogleMLKit/*` pods only ship `arm64-iphoneos` and `x86_64-iphonesimulator` slices and exclude `arm64` from simulator builds. On Apple Silicon Macs running iOS 26+ simulators (where Rosetta 2 is no longer the default for the iOS Simulator) this makes `flutter run` fail with `Unable to find a destination matching the provided destination specifier`. Issue tracked upstream by Google: https://issuetracker.google.com/issues/178965151. + +Until proper `arm64-iphonesimulator` slices are published, this plugin ships an **opt-in** Podfile helper that re-labels the existing arm64 device slice as iOS Simulator (the same `LC_BUILD_VERSION.platform` swap used by the well-known [`arm64-to-sim`](https://github.com/bogo/arm64-to-sim) tool) and strips the `EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64` from the generated xcconfigs. + +To enable it, add two lines to your iOS `Podfile`: + +```ruby +# Near the top, after `require ... podhelper ...`: +require File.expand_path( + '.symlinks/plugins/google_mlkit_commons/ios/scripts/apple_silicon_simulator', + __dir__, +) + +post_install do |installer| + # ...your existing post_install code... + + # Add this line at the end: + mlkit_apple_silicon_simulator_patch(installer) +end +``` + +Then re-run `pod install`. The example app under `packages/example` is wired up this way. + +The helper only changes vendored binaries inside `Pods/` and the `EXCLUDED_ARCHS` line in pod-generated xcconfigs. Device builds and release builds are unaffected. Remove the two lines to revert. + +#### Swift Package Manager (SPM) Support + +This plugin supports Swift Package Manager for iOS, which is the recommended way to manage iOS dependencies in Flutter 3.44+. CocoaPods support is deprecated and will be removed in future Flutter versions. + +No additional configuration is needed - Flutter will automatically detect and use the `Package.swift` file when building for iOS. The plugin uses the community-maintained [d-date/google-mlkit-swiftpm](https://github.com/d-date/google-mlkit-swiftpm) package for ML Kit binary dependencies. + +For more information, see: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + ### Android - minSdkVersion: 21 diff --git a/packages/google_mlkit_commons/ios/Package.swift b/packages/google_mlkit_commons/ios/Package.swift new file mode 100644 index 00000000..6ee698b5 --- /dev/null +++ b/packages/google_mlkit_commons/ios/Package.swift @@ -0,0 +1,36 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_commons. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_commons", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_commons", + targets: ["google_mlkit_commons"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_commons", + dependencies: [ + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_commons/ios/scripts/apple_silicon_simulator.rb b/packages/google_mlkit_commons/ios/scripts/apple_silicon_simulator.rb new file mode 100644 index 00000000..c483d5ca --- /dev/null +++ b/packages/google_mlkit_commons/ios/scripts/apple_silicon_simulator.rb @@ -0,0 +1,29 @@ +# Opt-in Podfile helper that lets Google ML Kit pods build for Apple Silicon +# iOS 26+ simulators. See packages/google_mlkit_commons/README.md (iOS +# section) for rationale and usage. Upstream Google bug: +# https://issuetracker.google.com/issues/178965151 + +def mlkit_apple_silicon_simulator_patch(installer) + pods_dir = File.expand_path(installer.sandbox.root.to_s) + patcher = File.expand_path('patch_arm64_simulator.py', __dir__) + + framework_dirs = Dir.glob(File.join(pods_dir, '{MLKit*,MLImage*}')) + .select { |d| File.directory?(d) } + unless framework_dirs.empty? + Pod::UI.puts '' + Pod::UI.puts "[ml_kit] Patching #{framework_dirs.size} ML Kit " \ + 'framework(s) for Apple Silicon iOS Simulator...' + unless system('python3', patcher, *framework_dirs) + Pod::UI.warn '[ml_kit] arm64 simulator patcher failed; ' \ + 'simulator build may still require Rosetta.' + end + end + + excluded = 'EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64' + Dir.glob(File.join(pods_dir, 'Target Support Files', '**', '*.xcconfig')) + .each do |xcconfig| + text = File.read(xcconfig) + new_text = text.lines.reject { |l| l.strip == excluded }.join + File.write(xcconfig, new_text) if text != new_text + end +end diff --git a/packages/google_mlkit_commons/ios/scripts/patch_arm64_simulator.py b/packages/google_mlkit_commons/ios/scripts/patch_arm64_simulator.py new file mode 100644 index 00000000..f7507eda --- /dev/null +++ b/packages/google_mlkit_commons/ios/scripts/patch_arm64_simulator.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python3 +"""Re-label the arm64 device slice of Google ML Kit static frameworks as +iOS Simulator. Walks every .o member of the arm64 archive and flips +LC_BUILD_VERSION.platform from 2 (iOS) to 7 (iOS Simulator); no +instructions or symbols are touched. Same approach as arm64-to-sim. +Idempotent. See packages/google_mlkit_commons/README.md (iOS section). + +Usage: python3 patch_arm64_simulator.py [ ...] +""" + +import os +import struct +import subprocess +import sys +import tempfile + +FAT_MAGIC = 0xCAFEBABE +FAT_MAGIC_64 = 0xCAFEBABF +MH_MAGIC_64 = 0xFEEDFACF +LC_BUILD_VERSION = 0x32 +PLATFORM_IOS = 2 +PLATFORM_IOS_SIMULATOR = 7 +CPU_TYPE_ARM64 = 0x0100000c + + +def _patch_macho_object(buf): + if len(buf) < 32: + return buf, False + magic = struct.unpack_from('\n': + return 0 + out = bytearray(data[:8]) + pos = 8 + n_patched = 0 + while pos + 60 <= len(data): + header = data[pos:pos + 60] + name = header[:16].rstrip().decode('ascii', errors='replace') + try: + size = int(header[48:58].rstrip().decode('ascii', errors='replace')) + except ValueError: + break + body_start = pos + 60 + body_end = body_start + size + body = data[body_start:body_end] + if name.startswith('#1/'): # BSD long-name extension + try: + name_len = int(name[3:]) + except ValueError: + name_len = 0 + obj_buf = data[body_start + name_len:body_end] + new_obj, patched = _patch_macho_object(obj_buf) + new_body = body[:name_len] + new_obj + else: + new_obj, patched = _patch_macho_object(body) + new_body = new_obj + if patched: + n_patched += 1 + out += header + new_body + pos = body_end + (body_end & 1) # 2-byte alignment + if n_patched > 0: + with open(archive_path, 'wb') as f: + f.write(bytes(out)) + return n_patched + + +def _patch_thin(path): + with open(path, 'rb') as f: + head = f.read(8) + if head[:8] == b'!\n': + return _patch_static_archive(path) + if len(head) >= 4 and struct.unpack('I', head[:4])[0] + if magic in (FAT_MAGIC, FAT_MAGIC_64): + archs = subprocess.run( + ['lipo', '-archs', fat_path], + capture_output=True, text=True, check=True, + ).stdout.strip().split() + if 'arm64' not in archs: + return 0 + with tempfile.TemporaryDirectory() as td: + arm64_thin = os.path.join(td, 'arm64.bin') + subprocess.run( + ['lipo', fat_path, '-thin', 'arm64', '-output', arm64_thin], + check=True, + ) + n = _patch_thin(arm64_thin) + if n == 0: + return 0 + subprocess.run( + ['lipo', fat_path, '-replace', 'arm64', arm64_thin, + '-output', fat_path], + check=True, + ) + return n + return _patch_thin(fat_path) + + +def _find_framework_binary(pod_dir): + fw_dir = os.path.join(pod_dir, 'Frameworks') + if not os.path.isdir(fw_dir): + return None + for name in os.listdir(fw_dir): + if name.endswith('.framework'): + base = name[:-len('.framework')] + binary = os.path.join(fw_dir, name, base) + if os.path.isfile(binary): + return binary + return None + + +def main(args): + if not args: + print(__doc__, file=sys.stderr) + return 1 + total = 0 + for path in args: + binary = _find_framework_binary(path) + if not binary: + continue + n = _patch_fat_binary(binary) + if n > 0: + print(f' patched {os.path.basename(binary)}: ' + f'{n} object(s) relabeled to iOS Simulator') + total += n + if total > 0: + print(f'[ml_kit] Total Mach-O objects relabeled: {total}') + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/packages/google_mlkit_digital_ink_recognition/ios/Package.swift b/packages/google_mlkit_digital_ink_recognition/ios/Package.swift new file mode 100644 index 00000000..ea8aa234 --- /dev/null +++ b/packages/google_mlkit_digital_ink_recognition/ios/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_digital_ink_recognition. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_digital_ink_recognition", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_digital_ink_recognition", + targets: ["google_mlkit_digital_ink_recognition"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_digital_ink_recognition", + dependencies: [ + .product(name: "MLKitDigitalInkRecognition", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_document_scanner/ios/Package.swift b/packages/google_mlkit_document_scanner/ios/Package.swift new file mode 100644 index 00000000..ca57a187 --- /dev/null +++ b/packages/google_mlkit_document_scanner/ios/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_document_scanner. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_document_scanner", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_document_scanner", + targets: ["google_mlkit_document_scanner"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_document_scanner", + dependencies: [ + .product(name: "MLKitDocumentScanner", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_entity_extraction/ios/Package.swift b/packages/google_mlkit_entity_extraction/ios/Package.swift new file mode 100644 index 00000000..90c35a1d --- /dev/null +++ b/packages/google_mlkit_entity_extraction/ios/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_entity_extraction. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_entity_extraction", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_entity_extraction", + targets: ["google_mlkit_entity_extraction"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_entity_extraction", + dependencies: [ + .product(name: "MLKitEntityExtraction", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_face_detection/ios/Package.swift b/packages/google_mlkit_face_detection/ios/Package.swift new file mode 100644 index 00000000..a08126a4 --- /dev/null +++ b/packages/google_mlkit_face_detection/ios/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_face_detection. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_face_detection", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_face_detection", + targets: ["google_mlkit_face_detection"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_face_detection", + dependencies: [ + .product(name: "MLKitFaceDetection", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_face_mesh_detection/ios/Package.swift b/packages/google_mlkit_face_mesh_detection/ios/Package.swift new file mode 100644 index 00000000..f82b5911 --- /dev/null +++ b/packages/google_mlkit_face_mesh_detection/ios/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_face_mesh_detection. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_face_mesh_detection", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_face_mesh_detection", + targets: ["google_mlkit_face_mesh_detection"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_face_mesh_detection", + dependencies: [ + .product(name: "MLKitFaceMesh", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_genai_image_description/ios/Package.swift b/packages/google_mlkit_genai_image_description/ios/Package.swift new file mode 100644 index 00000000..4f43b1f0 --- /dev/null +++ b/packages/google_mlkit_genai_image_description/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_genai_image_description. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_genai_image_description", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_genai_image_description", + targets: ["google_mlkit_genai_image_description"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_genai_image_description", + dependencies: [ + // No MLKit dependencies - iOS stub only + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_genai_prompt/ios/Package.swift b/packages/google_mlkit_genai_prompt/ios/Package.swift new file mode 100644 index 00000000..1982d43a --- /dev/null +++ b/packages/google_mlkit_genai_prompt/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_genai_prompt. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_genai_prompt", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_genai_prompt", + targets: ["google_mlkit_genai_prompt"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_genai_prompt", + dependencies: [ + // No MLKit dependencies - iOS stub only + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_genai_proofreading/ios/Package.swift b/packages/google_mlkit_genai_proofreading/ios/Package.swift new file mode 100644 index 00000000..8c09effb --- /dev/null +++ b/packages/google_mlkit_genai_proofreading/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_genai_proofreading. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_genai_proofreading", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_genai_proofreading", + targets: ["google_mlkit_genai_proofreading"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_genai_proofreading", + dependencies: [ + // No MLKit dependencies - iOS stub only + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_genai_rewriting/ios/Package.swift b/packages/google_mlkit_genai_rewriting/ios/Package.swift new file mode 100644 index 00000000..09bebcaa --- /dev/null +++ b/packages/google_mlkit_genai_rewriting/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_genai_rewriting. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_genai_rewriting", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_genai_rewriting", + targets: ["google_mlkit_genai_rewriting"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_genai_rewriting", + dependencies: [ + // No MLKit dependencies - iOS stub only + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_genai_speech_recognition/ios/Package.swift b/packages/google_mlkit_genai_speech_recognition/ios/Package.swift new file mode 100644 index 00000000..5e3f21fb --- /dev/null +++ b/packages/google_mlkit_genai_speech_recognition/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_genai_speech_recognition. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_genai_speech_recognition", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_genai_speech_recognition", + targets: ["google_mlkit_genai_speech_recognition"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_genai_speech_recognition", + dependencies: [ + // No MLKit dependencies - iOS stub only + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_genai_summarization/ios/Package.swift b/packages/google_mlkit_genai_summarization/ios/Package.swift new file mode 100644 index 00000000..a1496fbc --- /dev/null +++ b/packages/google_mlkit_genai_summarization/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_genai_summarization. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_genai_summarization", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_genai_summarization", + targets: ["google_mlkit_genai_summarization"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_genai_summarization", + dependencies: [ + // No MLKit dependencies - iOS stub only + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_image_labeling/ios/Package.swift b/packages/google_mlkit_image_labeling/ios/Package.swift new file mode 100644 index 00000000..d47ff42d --- /dev/null +++ b/packages/google_mlkit_image_labeling/ios/Package.swift @@ -0,0 +1,39 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_image_labeling. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_image_labeling", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_image_labeling", + targets: ["google_mlkit_image_labeling"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_image_labeling", + dependencies: [ + .product(name: "MLKitImageLabeling", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitImageLabelingCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVisionKit", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_language_id/ios/Package.swift b/packages/google_mlkit_language_id/ios/Package.swift new file mode 100644 index 00000000..66000ea3 --- /dev/null +++ b/packages/google_mlkit_language_id/ios/Package.swift @@ -0,0 +1,39 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_language_id. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_language_id", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_language_id", + targets: ["google_mlkit_language_id"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_language_id", + dependencies: [ + .product(name: "MLKitLanguageID", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitNaturalLanguage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitXenoCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "GoogleToolboxForMac", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_object_detection/ios/Package.swift b/packages/google_mlkit_object_detection/ios/Package.swift new file mode 100644 index 00000000..80382841 --- /dev/null +++ b/packages/google_mlkit_object_detection/ios/Package.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_object_detection. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_object_detection", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_object_detection", + targets: ["google_mlkit_object_detection"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_object_detection", + dependencies: [ + .product(name: "MLKitObjectDetection", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitObjectDetectionCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_pose_detection/ios/Package.swift b/packages/google_mlkit_pose_detection/ios/Package.swift new file mode 100644 index 00000000..db4057ed --- /dev/null +++ b/packages/google_mlkit_pose_detection/ios/Package.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_pose_detection. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_pose_detection", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_pose_detection", + targets: ["google_mlkit_pose_detection"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_pose_detection", + dependencies: [ + .product(name: "MLKitPoseDetection", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitPoseDetectionCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_selfie_segmentation/ios/Package.swift b/packages/google_mlkit_selfie_segmentation/ios/Package.swift new file mode 100644 index 00000000..1e718499 --- /dev/null +++ b/packages/google_mlkit_selfie_segmentation/ios/Package.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_selfie_segmentation. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_selfie_segmentation", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_selfie_segmentation", + targets: ["google_mlkit_selfie_segmentation"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_selfie_segmentation", + dependencies: [ + .product(name: "MLKitSegmentationSelfie", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitSegmentationCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_smart_reply/ios/Package.swift b/packages/google_mlkit_smart_reply/ios/Package.swift new file mode 100644 index 00000000..e70f94a4 --- /dev/null +++ b/packages/google_mlkit_smart_reply/ios/Package.swift @@ -0,0 +1,40 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_smart_reply. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_smart_reply", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_smart_reply", + targets: ["google_mlkit_smart_reply"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_smart_reply", + dependencies: [ + .product(name: "MLKitSmartReply", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitLanguageID", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitNaturalLanguage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitXenoCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "GoogleToolboxForMac", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_subject_segmentation/ios/Package.swift b/packages/google_mlkit_subject_segmentation/ios/Package.swift new file mode 100644 index 00000000..a579f636 --- /dev/null +++ b/packages/google_mlkit_subject_segmentation/ios/Package.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_subject_segmentation. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_subject_segmentation", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_subject_segmentation", + targets: ["google_mlkit_subject_segmentation"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_subject_segmentation", + dependencies: [ + .product(name: "MLKitSegmentationSubject", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitSegmentationCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_text_recognition/ios/Package.swift b/packages/google_mlkit_text_recognition/ios/Package.swift new file mode 100644 index 00000000..b82fe3f2 --- /dev/null +++ b/packages/google_mlkit_text_recognition/ios/Package.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_text_recognition. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_text_recognition", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_text_recognition", + targets: ["google_mlkit_text_recognition"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_text_recognition", + dependencies: [ + .product(name: "MLKitTextRecognition", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitTextRecognitionCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLImage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitVision", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +) diff --git a/packages/google_mlkit_translation/ios/Package.swift b/packages/google_mlkit_translation/ios/Package.swift new file mode 100644 index 00000000..4937c214 --- /dev/null +++ b/packages/google_mlkit_translation/ios/Package.swift @@ -0,0 +1,39 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// This Package.swift provides Swift Package Manager support for google_mlkit_translation. +// See: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors + +import PackageDescription + +let package = Package( + name: "google_mlkit_translation", + platforms: [ + .iOS("15.5") + ], + products: [ + .library( + name: "google_mlkit_translation", + targets: ["google_mlkit_translation"]) + ], + dependencies: [ + .package( + url: "https://github.com/d-date/google-mlkit-swiftpm", + from: "9.0.0" + ) + ], + targets: [ + .target( + name: "google_mlkit_translation", + dependencies: [ + .product(name: "MLKitTranslate", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitNaturalLanguage", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitXenoCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "MLKitCommon", package: "GoogleMLKitSwiftPM"), + .product(name: "GoogleToolboxForMac", package: "GoogleMLKitSwiftPM"), + .product(name: "Common", package: "GoogleMLKitSwiftPM"), + ], + path: "Classes" + ) + ] +)