#!/bin/sh # Builds this test app -- unless ./break-the-build exists, in which case it # fails instead. # # touch break-the-build # the next build fails # rm break-the-build # and then stops failing # # A marker file rather than an environment variable, because the point is to # change the outcome of a build somebody else starts: Dev Updater runs this # from a service with its own environment, and the phone is where the button # is. The file is gitignored, so the checked-in state is "works". # # The failure writes colour on stderr on purpose. A real compiler marks its # own errors that way, the app renders the escapes rather than stripping # them (AnsiLog.kt), and this is the cheapest way to have something to look # at that is not Dev Updater's own build. set -eu if [ -f break-the-build ]; then echo "@@progress 1/3" echo "==> Compiling" printf '\033[1;31merror\033[0m: cannot borrow `the_kettle` as mutable more than once\n' >&2 printf ' \033[1;34m-->\033[0m src/main.rs:12:5\n' >&2 printf '\033[1;31merror\033[0m: could not compile `breakable` (1 error)\n' >&2 echo "break-the-build is present, so this build failed on purpose." >&2 exit 1 fi exec ../lib/build-apk.sh \ --package com.example.dutest.breakable \ --label "Test Breakable"