mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-08 22:33:52 +00:00
Google have been releasing 'nonstandard' SDK versions for a while. Named
things like CANARY, UpsideDownCake, 36x, and so on, androidenv has been
generally unable to use them, instead preferring Google's officially
supported Android SDKs corresponding to the
[API levels](https://apilevels.com/) (e.g. "35" or "36").
Updates to those SDK versions have generally come in the form of
updates to Google's repositories that repo.json picks up.
These are mostly noneventful for end users, unless a user experienced a
bug in an API definition, then it tended to be picked up with an
androidenv repo update.
API 36.1 changes this. It's not just a number (so it doesn't correspond
to a unique API level). The previous attempt in #470569 simply preferred
the newer version to attempt to emulate the old behavior.
Unfortunately, this now requires a Gradle change (see #472561). So this
means we should just support all the strange SDK versions now and have a
test for it.
Note that only depending on "latest" (the default) will properly pick
these up as the latest, but using a min and max SDK version or
numLatestPlatformVersions > 1 will create a range of SDK versions as
before, which means you may miss (e.g.) 36.1 but will still have 36.
Considering that this requires `compileSdk "android-36.1"`
instead of a simple `compileSdk 36` in Gradle, it's recommended to
explicitly specify platformVersions if you depend on this change,
or use the defaults, where it will only install the latest.
(cherry picked from commit 03d6e4bc46)
How to update
nix-shell maintainers/scripts/update.nix --argstr package androidenv.test-suite --argstr commit true
How to run tests
You may need to make yourself familiar with package tests and Writing larger package tests, then run tests locally with:
$ export NIXPKGS_ALLOW_UNFREE=1
$ cd path/to/nixpkgs
$ nix-build -A androidenv.test-suite