* `builder_has_action` renamed to `builder_start_action`
* `builder_report` renamed to `builder_finish_action`
* `builder_has_action` created to be a silent test for the action
* Added reasonably comprehensive documentation.
Because BrowserStack tests are unreliable, I am disabling them for any
builds that are not specifically targeting web. Two ways that the tests
can be enabled:
1. Include '(web)' in the PR title
2. Include the label test-browserstack
This only impacts builds in the CI test environment, not anything else.
See build-utils-ci.inc.sh for helper functions for accessing PR
metadata, and build-utils-ci.test.sh for unit tests for this
functionality.
Fixes up scripts (except under /linux) to use `#!/usr/bin/env bash`
instead of `#!/bin/bash` or `#!/bin/sh` so that we don't end up with
the ancient version of bash supplied with macOS.
This became urgent with this PR, because of bash-4.xisms in
build-utils.sh, for example on line 572:
```
if [[ -v _builder_params[$e] ]]; then
```
Adds support for :target and --option to the builder_() functions in
build-utils.sh, along with a consistent way of describing command line
parameters in short-hand form, so we can avoid the display_usage getting
out of sync with actual command line parameters.
I opted to tweak the existing usage slightly, reversing parameter order
for `builder_report`, so that we could extend `builder_report` cleanly
to support targets.
The new builder_() functions are `builder_describe` and `builder_parse`,
which should be used in place for `builder_init` where you want to
provide more detailed command-line options (for many scripts, the
defaults provided through `builder_init` may suffice).
`builder_describe` lets you set a single-line description of the script,
along with a list of parameters: `actions`, `:targets` and `--options`.
Options may also specify a shorthand form, e.g. `--option,-o`. Each
parameter may optionally include a short description, separated by
space(s) from the parameter name.
build-utils.test.sh tests the functionality of the various functions,
and provides some examples of using them.
Defaults:
* If a target is not specified in `builder_describe`, a standard target
of `:project` will be available.
* If the user does not pass an action on the command line, then `build`
will be used.
* If the user does not pass a target on the command line, all targets
will have the actions applied.
Note, it is possible to have targets which do not use all actions. These
may be still be specified, but can be ignored. For example, `test:tools`
may not be an action:target that you handle in the script. At this time,
the builder_() functions do not attempt to check for this.