Dart, as of version 2.1.1, has a linter rule called
'unnecessary_await_in_return', described as 'Avoid returning
an awaited expression when the expression type is assignable
to the function's return type'. This can be found at
https://dart.dev/tools/linter-rules/unnecessary_await_in_return
VSCode applied that linter rule automatically, and I am tired of
the warnings, so I'm submitting this. :)
1. Update `ANDROID_SDK_ROOT` to `ANDROID_HOME`. The former variable is
deprecated. (see https://developer.android.com/tools/variables#envar)
2. Remove `ANDROID_NDK_HOME` environment variable. This should allow the
build script to work out of the box for more folks.
3. Check that Java is on the `PATH` as opposed to just installing it.
`asdf` and other runtime management tools are pretty popular, and all
we care about is that the Java version is accessible.
4. Remove calls to `sudo`. Check to see if CocoaPods exists, if it
doesn't install it using Homebrew which doesn't require `sudo`.
Targets have been parallelized so that initial push of the container cache should build the whole build a little quicker, plus the container should now use the cache for more of the build and so speed up normal builds to just the compilation and test of the code that has changed
The `build_cache` target now builds a `build-cache:latest` container that is stored in the GitLab project Container Registry, and then used (if it exists) by the `test_build` target. The `build_cache` task runs under 3 conditions, 1. the container does not exist, 2. if scheduled, 3. if run manually from the Pipelines page in the GitLab interface.
It is recommended that the build is set up to run on a weekly schedule via the `Pipeline schedules` page in GitLab with the schedule of `0 2 * * 6`.