chore(scripts): add WearOS build and launcher icon scripts
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SOURCE="${1:?Usage: ./scripts/generate-wearos-icon.sh <source-image>}"
|
||||
RES_DIR="targets/wearos/app/src/main/res"
|
||||
|
||||
if [ ! -f "$SOURCE" ]; then
|
||||
echo "Error: Source image not found: $SOURCE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SIZES=("48:mdpi" "72:hdpi" "96:xhdpi" "144:xxhdpi" "192:xxxhdpi")
|
||||
|
||||
for entry in "${SIZES[@]}"; do
|
||||
SIZE="${entry%%:*}"
|
||||
DENSITY="${entry##*:}"
|
||||
DIR="$RES_DIR/mipmap-$DENSITY"
|
||||
mkdir -p "$DIR"
|
||||
sips -z "$SIZE" "$SIZE" --out "$DIR/ic_launcher.png" "$SOURCE" > /dev/null
|
||||
echo "Created mipmap-$DENSITY/ic_launcher.png (${SIZE}x${SIZE})"
|
||||
done
|
||||
|
||||
echo "Done"
|
||||
Reference in New Issue
Block a user