From 15a85cea0bdd3fd301eea54284bfcdfc2b869340 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sat, 28 Mar 2026 20:22:48 +0800 Subject: [PATCH] Update iOS build settings and version metadata --- Makefile | 20 +++++++++++++++++--- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 8 ++++---- ios/Podfile.lock | 2 +- pubspec.yaml | 2 +- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 5b92660c..17378aa4 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,16 @@ PNPM ?= pnpm DART ?= dart DEVICE ?= macos APP_STORE_DART_DEFINE ?= --dart-define=XWORKMATE_APP_STORE=true +PUBSPEC_VERSION_LINE := $(shell sed -n 's/^version:[[:space:]]*//p' pubspec.yaml | head -n 1) +PUBSPEC_BUILD_DATE := $(shell sed -n 's/^build-date:[[:space:]]*//p' pubspec.yaml | head -n 1) +PUBSPEC_BUILD_ID := $(shell sed -n 's/^build-id:[[:space:]]*//p' pubspec.yaml | head -n 1) +APP_VERSION := $(firstword $(subst +, ,$(PUBSPEC_VERSION_LINE))) +APP_BUILD_NUMBER_RAW := $(word 2,$(subst +, ,$(PUBSPEC_VERSION_LINE))) +APP_BUILD_NUMBER := $(if $(APP_BUILD_NUMBER_RAW),$(APP_BUILD_NUMBER_RAW),1) +APP_DART_DEFINE_VERSION ?= --dart-define=XWORKMATE_DISPLAY_VERSION=$(APP_VERSION) +APP_DART_DEFINE_BUILD ?= --dart-define=XWORKMATE_BUILD_NUMBER=$(APP_BUILD_NUMBER) -.PHONY: help deps analyze test check format run open-macos-xcode build-linux build-macos build-ios-sim package-deb package-rpm package-linux package-mac install-mac clean build-go-core render-release-docs check-export-compliance +.PHONY: help deps analyze test check format run open-macos-xcode sync-version build-linux build-macos build-ios-sim package-deb package-rpm package-linux package-mac install-mac clean build-go-core render-release-docs check-export-compliance help: ## Show available targets @grep -E '^[a-zA-Z0-9_.-]+:.*?## ' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-18s %s\n", $$1, $$2}' @@ -30,6 +38,12 @@ format: ## Format Dart sources render-release-docs: ## Render feature matrix, roadmap, release notes, and changelog docs $(DART) run tool/render_release_docs.dart +sync-version: ## Show the version/build metadata sourced from pubspec.yaml + @echo "version=$(APP_VERSION)" + @echo "build=$(APP_BUILD_NUMBER)" + @echo "build-date=$(PUBSPEC_BUILD_DATE)" + @echo "build-id=$(PUBSPEC_BUILD_ID)" + run: ## Run the app on a device or desktop target (DEVICE=macos by default) $(FLUTTER) run -d $(DEVICE) @@ -40,11 +54,11 @@ build-linux: ## Build the Linux app in release mode $(FLUTTER) build linux --release build-macos: ## Build the macOS app in release mode - $(FLUTTER) build macos --release $(APP_STORE_DART_DEFINE) + $(FLUTTER) build macos --release $(APP_STORE_DART_DEFINE) --build-name=$(APP_VERSION) --build-number=$(APP_BUILD_NUMBER) $(APP_DART_DEFINE_VERSION) $(APP_DART_DEFINE_BUILD) bash scripts/check-apple-export-compliance.sh build/macos/Build/Products/Release/XWorkmate.app build-ios-sim: ## Build the iOS app for the simulator - $(FLUTTER) build ios --simulator $(APP_STORE_DART_DEFINE) + $(FLUTTER) build ios --simulator $(APP_STORE_DART_DEFINE) --build-name=$(APP_VERSION) --build-number=$(APP_BUILD_NUMBER) $(APP_DART_DEFINE_VERSION) $(APP_DART_DEFINE_BUILD) bash scripts/check-apple-export-compliance.sh build/ios/iphonesimulator/Runner.app build-go-core: ## Build the Go core helper diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index ec97fc6f..f0bd50e5 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1,3 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" +EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 i386 armv7 diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index c4855bfe..2b038169 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1,3 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" +EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 i386 armv7 diff --git a/ios/Podfile b/ios/Podfile index a3fdbfac..46e4e5b6 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -42,10 +42,10 @@ post_install do |installer| next unless ['mobile_scanner', 'Pods-Runner', 'Pods-RunnerTests'].include?(target.name) target.build_configurations.each do |config| - # mobile_scanner and the generated Pods aggregate targets exclude arm64 - # simulators upstream, which breaks Apple Silicon simulator builds with - # missing module / missing Pods_Runner.framework errors. - config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'i386 armv7' + # mobile_scanner and the generated Pods aggregate targets need to avoid + # arm64 on simulators here because MLImage ships a device-only object + # slice that fails when the Apple Silicon simulator tries to link it. + config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386 armv7' end end end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index fa59f7f9..c776d18d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -132,6 +132,6 @@ SPEC CHECKSUMS: shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb super_native_extensions: b763c02dc3a8fd078389f410bf15149179020cb4 -PODFILE CHECKSUM: 18611600007ab4a15dd4fb907f17ed9b6a3dcf8f +PODFILE CHECKSUM: 612706ed53555a28e529d2b87297b10550c80134 COCOAPODS: 1.16.2 diff --git a/pubspec.yaml b/pubspec.yaml index ef006e93..61977958 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.1+3 build-date: 2026-03-28 -build-id: cc00864 +build-id: f153d7b environment: sdk: ^3.11.0