#!/bin/sh # "Builds" this project's daemon, which is a shell script and so needs no # building at all. What it actually does is take a few seconds and report # progress, because that is the thing worth having: a component slow enough # to watch a bar move on, next to an APK component that finishes in two # seconds. A card with one instant component and one slow one is how you see # whether the per-component timings and the concurrent build really are per # component. # # It takes the build mode as its one argument, so that this fixture # exercises a component with more than one way of being built. `release` # is deliberately the slow one, which is both what a real optimised build # is and what makes a mode switch visible on the card: a bar that takes # eight seconds and one that takes two. set -eu MODE="${1:-release}" case "$MODE" in release) STEPS=8 ;; debug) STEPS=2 ;; *) echo "unknown build mode: $MODE (expected release or debug)" >&2 exit 2 ;; esac i=0 while [ "$i" -lt "$STEPS" ]; do i=$((i + 1)) echo "@@progress $i/$STEPS" echo "==> Pretending to compile part $i of $STEPS ($MODE)" sleep 1 done chmod +x ./serve.sh echo "==> Daemon ready ($MODE)"