diff --git a/doc/languages-frameworks/android.section.md b/doc/languages-frameworks/android.section.md index db4aea04e5e0..3d77c332dca6 100644 --- a/doc/languages-frameworks/android.section.md +++ b/doc/languages-frameworks/android.section.md @@ -39,24 +39,12 @@ with import {}; let androidComposition = androidenv.composeAndroidPackages { - cmdLineToolsVersion = "8.0"; - toolsVersion = "26.1.1"; - platformToolsVersion = "30.0.5"; - buildToolsVersions = [ "30.0.3" ]; - includeEmulator = false; - emulatorVersion = "30.3.4"; - platformVersions = [ "28" "29" "30" ]; - includeSources = false; - includeSystemImages = false; + platformVersions = [ "34" "35" ]; systemImageTypes = [ "google_apis_playstore" ]; abiVersions = [ "armeabi-v7a" "arm64-v8a" ]; - cmakeVersions = [ "3.10.2" ]; includeNDK = true; - ndkVersions = ["22.0.7026061"]; - useGoogleAPIs = false; - useGoogleTVAddOns = false; includeExtras = [ - "extras;google;gcm" + "extras;google;auto" ]; }; in @@ -69,27 +57,37 @@ exceptions are the tools, platform-tools and build-tools sub packages. The following parameters are supported: -* `cmdLineToolsVersion `, specifies the version of the `cmdline-tools` package to use +* `cmdLineToolsVersion `, specifies the version of the `cmdline-tools` package to use. + It defaults to the latest. * `toolsVersion`, specifies the version of the `tools` package. Notice `tools` is obsolete, and currently only `26.1.1` is available, so there's not a lot of - options here, however, you can set it as `null` if you don't want it. -* `platformsToolsVersion` specifies the version of the `platform-tools` plugin + options here, however, you can set it as `null` if you don't want it. It defaults + to the latest. +* `platformToolsVersion` specifies the version of the `platform-tools` plugin. + It defaults to the latest. * `buildToolsVersions` specifies the versions of the `build-tools` plugins to - use. + use. It defaults to the latest. * `includeEmulator` specifies whether to deploy the emulator package (`false` by default). When enabled, the version of the emulator to deploy can be - specified by setting the `emulatorVersion` parameter. + specified by setting the `emulatorVersion` parameter. If set to `null` or + `"if-supported"`, it will deploy the emulator if it's supported by the system. +* `includeCmake` specifies whether CMake should be included. It defaults to true + on x86-64 and Darwin platforms, and also supports `null` and `"if-supported"`. * `cmakeVersions` specifies which CMake versions should be deployed. + It defaults to the latest. * `includeNDK` specifies that the Android NDK bundle should be included. - Defaults to: `false`. + Defaults to: `false` though can be set to `true`, `null`, or `"if-supported"`. * `ndkVersions` specifies the NDK versions that we want to use. These are linked under the `ndk` directory of the SDK root, and the first is linked under the - `ndk-bundle` directory. + `ndk-bundle` directory. It defaults to the latest. * `ndkVersion` is equivalent to specifying one entry in `ndkVersions`, and `ndkVersions` overrides this parameter if provided. * `includeExtras` is an array of identifier strings referring to arbitrary - add-on packages that should be installed. + add-on packages that should be installed. Note that extras may not be compatible + with all platforms (for example, the Google TV head unit does not have an aarch64-linux + compile). * `platformVersions` specifies which platform SDK versions should be included. + It defaults to including only the latest API level, though you can add more. For each platform version that has been specified, we can apply the following options: @@ -108,9 +106,10 @@ For each requested system image we can specify the following options: * `systemImageTypes` specifies what kind of system images should be included. Defaults to: `default`. * `abiVersions` specifies what kind of ABI version of each system image should - be included. Defaults to: `armeabi-v7a`. + be included. Defaults to `armeabi-v7a` and `arm64-v8a`. -Most of the function arguments have reasonable default settings. +Most of the function arguments have reasonable default settings, preferring the latest +versions of tools when possible. You can specify license names: @@ -127,7 +126,8 @@ pull from: by running `generate.sh`, which in turn will call into `mkrepo.rb`. * `repoXmls` is an attribute set containing paths to repo XML files. If specified, it takes priority over `repoJson`, and will trigger a local build writing out a - repo.json to the Nix store based on the given repository XMLs. + repo.json to the Nix store based on the given repository XMLs. Note that this uses + import-from-derivation. ```nix { @@ -312,7 +312,9 @@ android { ## Querying the available versions of each plugin {#querying-the-available-versions-of-each-plugin} -repo.json provides all the options in one file now. +All androidenv packages are available on [search.nixos.org](https://search.nixos.org). + +Additionally, repo.json provides all the options in one file now. A shell script in the `pkgs/development/mobile/androidenv/` subdirectory can be used to retrieve all possible options: @@ -326,13 +328,15 @@ The above command-line instruction queries all package versions in repo.json. ## Updating the generated expressions {#updating-the-generated-expressions} repo.json is generated from XML files that the Android Studio package manager uses. -To update the expressions run the `generate.sh` script that is stored in the +To update the expressions run the `update.sh` script that is stored in the `pkgs/development/mobile/androidenv/` subdirectory: ```bash -./generate.sh +./update.sh ``` +This is run automatically by the nixpkgs update script. + ## Building an Android application with Ant {#building-an-android-application-with-ant} In addition to the SDK, it is also possible to build an Ant-based Android