From 8aac3da7a8bc3a5d486c86259a938e7f35f6e4c0 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 10 Jul 2026 15:46:42 +0200 Subject: [PATCH] Add workaround for swift package manager for the health package --- ios/Flutter/Debug.xcconfig | 1 - ios/Flutter/Release.xcconfig | 1 - ios/Runner.xcodeproj/project.pbxproj | 14 +++---------- lib/features/health/models/health_metric.dart | 2 +- .../health/models/health_reading.dart | 2 +- .../health/providers/health_repository.dart | 2 +- .../health/providers/health_sync.dart | 2 +- pubspec.lock | 21 +++++++------------ pubspec.yaml | 10 ++++++++- .../health/providers/health_sync_test.dart | 2 +- .../providers/health_sync_test.mocks.dart | 2 +- 11 files changed, 25 insertions(+), 34 deletions(-) diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index ec97fc6f3..592ceee85 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index c4855bfe2..592ceee85 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 08bd47e13..006be35e8 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -77,7 +77,6 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - BB0286322FD60C00014F981C /* Pods */, ); sourceTree = ""; }; @@ -105,13 +104,6 @@ path = Runner; sourceTree = ""; }; - BB0286322FD60C00014F981C /* Pods */ = { - isa = PBXGroup; - children = ( - ); - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -295,7 +287,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -383,7 +375,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -432,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/features/health/models/health_metric.dart b/lib/features/health/models/health_metric.dart index a4afdc9a4..a1e48102a 100644 --- a/lib/features/health/models/health_metric.dart +++ b/lib/features/health/models/health_metric.dart @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import 'package:health/health.dart'; +import 'package:health_bridge/health.dart'; import 'package:wger/features/measurements/models/measurement_category.dart'; /// A body metric that can be imported from Apple Health / Health Connect into a diff --git a/lib/features/health/models/health_reading.dart b/lib/features/health/models/health_reading.dart index 1a6e52200..64101adf7 100644 --- a/lib/features/health/models/health_reading.dart +++ b/lib/features/health/models/health_reading.dart @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import 'package:health/health.dart'; +import 'package:health_bridge/health.dart'; /// A single reading pulled from a health platform, reduced to the fields the /// importer needs. Keeps the `health` package's [HealthDataPoint] out of the diff --git a/lib/features/health/providers/health_repository.dart b/lib/features/health/providers/health_repository.dart index 95c6e8a6c..c70d8032b 100644 --- a/lib/features/health/providers/health_repository.dart +++ b/lib/features/health/providers/health_repository.dart @@ -19,7 +19,7 @@ import 'dart:io'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:health/health.dart'; +import 'package:health_bridge/health.dart'; import 'package:logging/logging.dart'; import 'package:wger/features/health/models/health_reading.dart'; diff --git a/lib/features/health/providers/health_sync.dart b/lib/features/health/providers/health_sync.dart index f0a5d1b74..b45c8edd0 100644 --- a/lib/features/health/providers/health_sync.dart +++ b/lib/features/health/providers/health_sync.dart @@ -17,7 +17,7 @@ */ import 'package:collection/collection.dart'; -import 'package:health/health.dart'; +import 'package:health_bridge/health.dart'; import 'package:logging/logging.dart'; import 'package:powersync/powersync.dart' as ps; import 'package:riverpod_annotation/riverpod_annotation.dart'; diff --git a/pubspec.lock b/pubspec.lock index 76fb0255c..224fca8d6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -193,14 +193,6 @@ packages: url: "https://pub.dev" source: hosted version: "5.1.2" - carp_serializable: - dependency: transitive - description: - name: carp_serializable - sha256: f039f8ea22e9437aef13fe7e9743c3761c76d401288dcb702eadd273c3e4dcef - url: "https://pub.dev" - source: hosted - version: "2.0.1" change: dependency: transitive description: @@ -743,14 +735,15 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" - health: + health_bridge: dependency: "direct main" description: - name: health - sha256: "2d9e119f3a1d281139f93149b41032b9f80b759960875bc784c5a25dd3c17524" - url: "https://pub.dev" - source: hosted - version: "13.3.1" + path: "." + ref: "51a567db9a97ccb15a9c1138aa4bcbdaf3d6c7b1" + resolved-ref: "51a567db9a97ccb15a9c1138aa4bcbdaf3d6c7b1" + url: "https://github.com/ytsni/health_bridge.git" + source: git + version: "1.0.0" hooks: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4567b8a03..8ddb61f9c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,7 +51,15 @@ dependencies: flutter_zxing: ^2.3.0 font_awesome_flutter: ^11.0.0 freezed_annotation: ^3.1.0 - health: ^13.3.1 + # Temporarily swap `health` with a fork with Swift Package Manager support. + # Once that is available on upstream (see e.g. https://github.com/carp-dk/carp-health-flutter/issues/480 ) + # we can switch back. Note that if this doesn't happen in the near future we + # can just re-activate the cocoapods infrastructure. + # health: ^13.3.1 + health_bridge: + git: + url: https://github.com/ytsni/health_bridge.git + ref: 51a567db9a97ccb15a9c1138aa4bcbdaf3d6c7b1 http: ^1.6.0 image_picker: ^1.2.2 intl: ^0.20.2 diff --git a/test/features/health/providers/health_sync_test.dart b/test/features/health/providers/health_sync_test.dart index 2f3b66864..5f94eaf73 100644 --- a/test/features/health/providers/health_sync_test.dart +++ b/test/features/health/providers/health_sync_test.dart @@ -18,7 +18,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:health/health.dart'; +import 'package:health_bridge/health.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart'; diff --git a/test/features/health/providers/health_sync_test.mocks.dart b/test/features/health/providers/health_sync_test.mocks.dart index 938babcd9..0fde5d99f 100644 --- a/test/features/health/providers/health_sync_test.mocks.dart +++ b/test/features/health/providers/health_sync_test.mocks.dart @@ -5,7 +5,7 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; -import 'package:health/health.dart' as _i5; +import 'package:health_bridge/health.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i3; import 'package:wger/features/health/models/health_reading.dart' as _i6;