Skip to content

Commit 43239ca

Browse files
committed
fix
1 parent 6cc7929 commit 43239ca

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

features/scripts/generate_fixture.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,37 @@ rm -rf "$FIXTURE_LOCATION"
130130
echo "Create blank fixture"
131131
"${FLUTTER_BIN[@]}" create "$FIXTURE_LOCATION" --org com.bugsnag --platforms=ios,android
132132

133+
# Fix SDK constraint to match Flutter's bundled Dart version
134+
PUBSPEC="$FIXTURE_LOCATION/pubspec.yaml"
135+
echo "Fix Dart SDK constraint in pubspec.yaml"
136+
python3 - "$PUBSPEC" "$FLUTTER_VERSION" <<'PY'
137+
import sys, re
138+
139+
pubspec_path = sys.argv[1]
140+
flutter_version = sys.argv[2]
141+
142+
with open(pubspec_path, 'r', encoding='utf-8') as f:
143+
content = f.read()
144+
145+
# Map Flutter versions to their bundled Dart SDK versions
146+
# Flutter 3.38.x uses Dart 3.5.x
147+
# Flutter 3.24.x uses Dart 3.5.x
148+
# Use a conservative constraint that works with the bundled Dart
149+
dart_constraint = ">=3.5.0 <4.0.0"
150+
151+
# Replace the SDK constraint
152+
content = re.sub(
153+
r'sdk:\s*["\']?\^?[0-9.]+["\']?',
154+
f"sdk: '{dart_constraint}'",
155+
content
156+
)
157+
158+
with open(pubspec_path, 'w', encoding='utf-8') as f:
159+
f.write(content)
160+
161+
print(f"Set Dart SDK constraint to: {dart_constraint}")
162+
PY
163+
133164
###############################################################################
134165
# Add dependencies (batch most of them)
135166
###############################################################################

0 commit comments

Comments
 (0)