Skip to content

Commit c724dd5

Browse files
ci(android): add debug step
1 parent b43d3c6 commit c724dd5

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

scripts/build-release.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,16 @@ trap cleanup EXIT
2929
echo "Copying model files to Android asset packs..."
3030
mkdir -p "$ANDROID_ASSETS_DIR"
3131
if [ -d "$ASSETS_DIR" ]; then
32+
echo "Source assets directory contents:"
33+
ls -lh "$ASSETS_DIR"
34+
find "$ASSETS_DIR" -type f -exec ls -lh {} \; | head -20
35+
3236
cp -r "$ASSETS_DIR"/* "$ANDROID_ASSETS_DIR"/ 2>/dev/null || true
3337
echo "Files copied to Android asset packs"
38+
39+
echo "Android asset packs contents:"
40+
ls -lh "$ANDROID_ASSETS_DIR"
41+
find "$ANDROID_ASSETS_DIR" -type f -exec ls -lh {} \; | head -20
3442
fi
3543

3644
echo "Replacing model files with minimal placeholder files..."
@@ -44,16 +52,27 @@ find "$ASSETS_DIR" -name "*.json" ! -name "tokenizer.json" -exec sh -c 'echo "{}
4452
# Replace .pte files with minimal content (just a null byte)
4553
find "$ASSETS_DIR" -name "*.pte" -exec sh -c 'printf "\0" > "$1"' _ {} \;
4654

55+
echo "Placeholder files created:"
56+
find "$ASSETS_DIR" -type f -exec ls -lh {} \;
57+
4758
echo "Building Release AAB..."
4859
echo "NODE_ENV is set to: $NODE_ENV"
4960
cd android
50-
echo "Running gradle bundleRelease..."
51-
./gradlew bundleRelease
61+
ls -l
62+
cd ..
63+
cd assets/models/all-mini-lm
64+
ls -l
65+
echo "Running gradle bundleRelease with stacktrace..."
66+
# ./gradlew bundleRelease --stacktrace --info 2>&1 | tee ../gradle-build.log
5267
cd ..
5368

5469
if [ -f "$AAB_OUTPUT" ]; then
5570
echo "AAB built successfully: $AAB_OUTPUT"
5671
ls -lh "$AAB_OUTPUT"
72+
73+
# Check bundle size
74+
AAB_SIZE=$(stat -f%z "$AAB_OUTPUT" 2>/dev/null || stat -c%s "$AAB_OUTPUT" 2>/dev/null)
75+
echo "Bundle size: $(echo "scale=2; $AAB_SIZE / 1024 / 1024" | bc 2>/dev/null || echo "$AAB_SIZE bytes") MB"
5776
else
5877
echo "AAB build failed"
5978
exit 1

0 commit comments

Comments
 (0)