Skip to content

Commit

Permalink
fix(tool): Run inkscape sequentially to prevent segfaults
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Sep 1, 2024
1 parent ae9fc89 commit 5ea55e0
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions tool/generate-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ function export_icon() {
size="$2"
name="$3"
dpi="$4"
inkscape "$source" -o "android/app/src/main/res/mipmap-${dpi}dpi/$name.png" -w "$size" -h "$size" --actions="export-background:$color" &
inkscape "$source" -o "android/app/src/main/res/drawable-${dpi}dpi/${name}_foreground.png" -w "$size" -h "$size" --actions="export-background:$color" &
inkscape "$source" -o "android/app/src/main/res/drawable-${dpi}dpi/${name}_monochrome.png" -w "$size" -h "$size" &
wait
inkscape "$source" -o "android/app/src/main/res/mipmap-${dpi}dpi/$name.png" -w "$size" -h "$size" --actions="export-background:$color"
inkscape "$source" -o "android/app/src/main/res/drawable-${dpi}dpi/${name}_foreground.png" -w "$size" -h "$size" --actions="export-background:$color"
inkscape "$source" -o "android/app/src/main/res/drawable-${dpi}dpi/${name}_monochrome.png" -w "$size" -h "$size"
}

function generate_adaptive_icon() {
Expand All @@ -51,13 +50,12 @@ function generate_adaptive_icon() {
function export_icon_all() {
source="$1"
name="$2"
export_icon "$source" 72 "$name" h &
export_icon "$source" 48 "$name" m &
export_icon "$source" 96 "$name" xh &
export_icon "$source" 144 "$name" xxh &
export_icon "$source" 192 "$name" xxxh &
generate_adaptive_icon "$name" &
wait
export_icon "$source" 72 "$name" h
export_icon "$source" 48 "$name" m
export_icon "$source" 96 "$name" xh
export_icon "$source" 144 "$name" xxh
export_icon "$source" 192 "$name" xxxh
generate_adaptive_icon "$name"
}

function precompile_assets() {
Expand Down Expand Up @@ -113,9 +111,8 @@ copy_app_svg talk external/nextcloud-spreed

for path in ../packages/*_app; do
icon="$(basename "$path")"
export_icon_all "$path/assets/app.svg" "$icon" &
export_icon_all "$path/assets/app.svg" "$icon"
done
wait

fvm dart run flutter_native_splash:create
fvm dart run sqflite_common_ffi_web:setup --force
Expand Down

0 comments on commit 5ea55e0

Please sign in to comment.