Skip to content

Commit 37e3088

Browse files
committed
fix(build): fix builder for api for cross platform
1 parent 8c01648 commit 37e3088

1 file changed

Lines changed: 35 additions & 2 deletions

File tree

cross-platform/build.sh

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,48 @@ fi
4141

4242
export PATH="$PATH:$FLUTTER_DIR/bin"
4343

44+
# --- Generate Lam7aApi package ---
45+
echo "🔧 Generating OpenAPI client (Lam7aApi)..."
46+
if [ -f ./tools/update_api.dart ]; then
47+
dart run ./tools/update_api.dart
48+
else
49+
echo "⚠️ update_api.dart not found, creating minimal Lam7aApi package..."
50+
mkdir -p ../Lam7aApi
51+
cat > ../Lam7aApi/pubspec.yaml << 'EOF'
52+
name: openapi
53+
description: Generated OpenAPI client
54+
publish_to: 'none'
55+
version: 1.0.0
56+
57+
environment:
58+
sdk: ^3.9.2
59+
60+
dependencies:
61+
flutter:
62+
sdk: flutter
63+
dio: ^5.9.0
64+
json_annotation: ^4.9.0
65+
66+
dev_dependencies:
67+
flutter_test:
68+
sdk: flutter
69+
json_serializable: ^6.11.1
70+
build_runner: ^2.7.1
71+
EOF
72+
mkdir -p ../Lam7aApi/lib
73+
echo "// Generated API client" > ../Lam7aApi/lib/openapi.dart
74+
fi
4475

4576
# --- Flutter build steps ---
4677
cd lam7a
4778
echo "📦 Fetching dependencies..."
48-
flutter pub get
79+
flutter pub get --verbose
80+
81+
echo "🔨 Running build_runner to generate APIs..."
4982
flutter pub run build_runner build --delete-conflicting-outputs
5083

5184
echo "📱 Building Android APK..."
52-
flutter build apk --release
85+
flutter build apk --release --verbose
5386

5487
# --- macOS-specific: build iOS if available ---
5588
if [[ "$OSTYPE" == "darwin"* ]]; then

0 commit comments

Comments
 (0)