Skip to content

Commit 9b09e54

Browse files
bluzernameclaude
andcommitted
Improve Xcode Cloud script with pinned Flutter version and logging
Pin Flutter to 3.27.3, add precache step, add verbose logging to diagnose CI failures, and suppress non-critical analytics errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6ff7d9e commit 9b09e54

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

ios/ci_scripts/ci_post_clone.sh

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
11
#!/bin/sh
22
set -e
33

4-
# Navigate to project root (ci_scripts is inside ios/)
4+
echo "=== ci_post_clone.sh starting ==="
5+
echo "CI_PRIMARY_REPOSITORY_PATH: $CI_PRIMARY_REPOSITORY_PATH"
6+
echo "CI_WORKSPACE: $CI_WORKSPACE"
7+
echo "PWD: $(pwd)"
8+
9+
# Navigate to project root
510
cd "$CI_PRIMARY_REPOSITORY_PATH"
11+
echo "=== Changed to project root: $(pwd) ==="
12+
13+
# Install Flutter (pinned to the version used locally)
14+
echo "=== Installing Flutter 3.27.3 ==="
15+
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.27.3 "$HOME/flutter"
16+
export PATH="$HOME/flutter/bin:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH"
617

7-
# Install Flutter
8-
git clone https://github.com/flutter/flutter.git --depth 1 -b stable "$HOME/flutter"
9-
export PATH="$HOME/flutter/bin:$PATH"
18+
echo "=== Flutter version ==="
19+
flutter --version
1020

1121
# Disable analytics in CI
12-
flutter config --no-analytics
13-
dart --disable-analytics
22+
flutter config --no-analytics 2>/dev/null || true
23+
dart --disable-analytics 2>/dev/null || true
24+
25+
# Precache iOS artifacts
26+
echo "=== Precaching iOS build tools ==="
27+
flutter precache --ios
1428

1529
# Get Flutter dependencies and generate files (including Generated.xcconfig)
30+
echo "=== Running flutter pub get ==="
1631
flutter pub get
1732

33+
# Verify Generated.xcconfig was created
34+
if [ -f "ios/Flutter/Generated.xcconfig" ]; then
35+
echo "=== Generated.xcconfig created successfully ==="
36+
cat ios/Flutter/Generated.xcconfig
37+
else
38+
echo "ERROR: Generated.xcconfig was NOT created"
39+
exit 1
40+
fi
41+
1842
# Install CocoaPods dependencies
43+
echo "=== Running pod install ==="
1944
cd ios
2045
pod install
46+
47+
echo "=== ci_post_clone.sh completed successfully ==="

0 commit comments

Comments
 (0)