mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-22 04:57:56 +03:00
{doc/android,release-notes}: update android-studio and androidenv
This commit is contained in:
parent
859a6056d3
commit
7f03a67b0b
@ -3,10 +3,36 @@
|
|||||||
The Android build environment provides three major features and a number of
|
The Android build environment provides three major features and a number of
|
||||||
supporting features.
|
supporting features.
|
||||||
|
|
||||||
|
## Using androidenv with Android Studio {#using-androidenv-with-android-studio}
|
||||||
|
|
||||||
|
Use the `android-studio-full` attribute for a very complete Android SDK, including system images:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
buildInputs = [ android-studio-full ];
|
||||||
|
```
|
||||||
|
|
||||||
|
This is identical to:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
buildInputs = [ androidStudioPackages.stable.full ];
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can pass composeAndroidPackages to the `withSdk` passthru:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
buildInputs = [
|
||||||
|
(android-studio.withSdk (androidenv.composeAndroidPackages {
|
||||||
|
includeNDK = true;
|
||||||
|
}).androidsdk)
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
These will export ANDROID_SDK_ROOT and ANDROID_NDK_ROOT to the SDK and NDK directories
|
||||||
|
in the specified Android build environment.
|
||||||
|
|
||||||
## Deploying an Android SDK installation with plugins {#deploying-an-android-sdk-installation-with-plugins}
|
## Deploying an Android SDK installation with plugins {#deploying-an-android-sdk-installation-with-plugins}
|
||||||
|
|
||||||
The first use case is deploying the SDK with a desired set of plugins or subsets
|
Alternatively, you can deploy the SDK separately with a desired set of plugins, or subsets of an SDK.
|
||||||
of an SDK.
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
with import <nixpkgs> {};
|
with import <nixpkgs> {};
|
||||||
@ -145,16 +171,14 @@ androidComposition.platform-tools
|
|||||||
## Using predefined Android package compositions {#using-predefined-android-package-compositions}
|
## Using predefined Android package compositions {#using-predefined-android-package-compositions}
|
||||||
|
|
||||||
In addition to composing an Android package set manually, it is also possible
|
In addition to composing an Android package set manually, it is also possible
|
||||||
to use a predefined composition that contains all basic packages for a specific
|
to use a predefined composition that contains a fairly complete set of Android packages:
|
||||||
Android version, such as version 9.0 (API-level 28).
|
|
||||||
|
|
||||||
The following Nix expression can be used to deploy the entire SDK with all basic
|
The following Nix expression can be used to deploy the entire SDK:
|
||||||
plugins:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
with import <nixpkgs> {};
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
androidenv.androidPkgs_9_0.androidsdk
|
androidenv.androidPkgs.androidsdk
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also possible to use one plugin only:
|
It is also possible to use one plugin only:
|
||||||
@ -162,50 +186,9 @@ It is also possible to use one plugin only:
|
|||||||
```nix
|
```nix
|
||||||
with import <nixpkgs> {};
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
androidenv.androidPkgs_9_0.platform-tools
|
androidenv.androidPkgs.platform-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building an Android application {#building-an-android-application}
|
|
||||||
|
|
||||||
In addition to the SDK, it is also possible to build an Ant-based Android
|
|
||||||
project and automatically deploy all the Android plugins that a project
|
|
||||||
requires.
|
|
||||||
|
|
||||||
|
|
||||||
```nix
|
|
||||||
with import <nixpkgs> {};
|
|
||||||
|
|
||||||
androidenv.buildApp {
|
|
||||||
name = "MyAndroidApp";
|
|
||||||
src = ./myappsources;
|
|
||||||
release = true;
|
|
||||||
|
|
||||||
# If release is set to true, you need to specify the following parameters
|
|
||||||
keyStore = ./keystore;
|
|
||||||
keyAlias = "myfirstapp";
|
|
||||||
keyStorePassword = "mykeystore";
|
|
||||||
keyAliasPassword = "myfirstapp";
|
|
||||||
|
|
||||||
# Any Android SDK parameters that install all the relevant plugins that a
|
|
||||||
# build requires
|
|
||||||
platformVersions = [ "24" ];
|
|
||||||
|
|
||||||
# When we include the NDK, then ndk-build is invoked before Ant gets invoked
|
|
||||||
includeNDK = true;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Aside from the app-specific build parameters (`name`, `src`, `release` and
|
|
||||||
keystore parameters), the `buildApp {}` function supports all the function
|
|
||||||
parameters that the SDK composition function (the function shown in the
|
|
||||||
previous section) supports.
|
|
||||||
|
|
||||||
This build function is particularly useful when it is desired to use
|
|
||||||
[Hydra](https://nixos.org/hydra): the Nix-based continuous integration solution
|
|
||||||
to build Android apps. An Android APK gets exposed as a build product and can be
|
|
||||||
installed on any Android device with a web browser by navigating to the build
|
|
||||||
result page.
|
|
||||||
|
|
||||||
## Spawning emulator instances {#spawning-emulator-instances}
|
## Spawning emulator instances {#spawning-emulator-instances}
|
||||||
|
|
||||||
For testing purposes, it can also be quite convenient to automatically generate
|
For testing purposes, it can also be quite convenient to automatically generate
|
||||||
@ -349,3 +332,44 @@ To update the expressions run the `generate.sh` script that is stored in the
|
|||||||
```bash
|
```bash
|
||||||
./generate.sh
|
./generate.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 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
|
||||||
|
project and automatically deploy all the Android plugins that a project
|
||||||
|
requires. Most newer Android projects use Gradle, and this is included for historical
|
||||||
|
purposes.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
|
androidenv.buildApp {
|
||||||
|
name = "MyAndroidApp";
|
||||||
|
src = ./myappsources;
|
||||||
|
release = true;
|
||||||
|
|
||||||
|
# If release is set to true, you need to specify the following parameters
|
||||||
|
keyStore = ./keystore;
|
||||||
|
keyAlias = "myfirstapp";
|
||||||
|
keyStorePassword = "mykeystore";
|
||||||
|
keyAliasPassword = "myfirstapp";
|
||||||
|
|
||||||
|
# Any Android SDK parameters that install all the relevant plugins that a
|
||||||
|
# build requires
|
||||||
|
platformVersions = [ "24" ];
|
||||||
|
|
||||||
|
# When we include the NDK, then ndk-build is invoked before Ant gets invoked
|
||||||
|
includeNDK = true;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Aside from the app-specific build parameters (`name`, `src`, `release` and
|
||||||
|
keystore parameters), the `buildApp {}` function supports all the function
|
||||||
|
parameters that the SDK composition function (the function shown in the
|
||||||
|
previous section) supports.
|
||||||
|
|
||||||
|
This build function is particularly useful when it is desired to use
|
||||||
|
[Hydra](https://nixos.org/hydra): the Nix-based continuous integration solution
|
||||||
|
to build Android apps. An Android APK gets exposed as a build product and can be
|
||||||
|
installed on any Android device with a web browser by navigating to the build
|
||||||
|
result page.
|
||||||
|
@ -524,6 +524,10 @@ Use `services.pipewire.extraConfig` or `services.pipewire.configPackages` for Pi
|
|||||||
- to get previous behaviour of upstream defaults, set it to `null`
|
- to get previous behaviour of upstream defaults, set it to `null`
|
||||||
- default value has changed from `[]` to `null`, in order to preserve default behaviour
|
- default value has changed from `[]` to `null`, in order to preserve default behaviour
|
||||||
|
|
||||||
|
- `androidenv.androidPkgs_9_0` has been removed, and replaced with `androidenv.androidPkgs` for a more complete Android SDK including support for Android 9 and later.
|
||||||
|
|
||||||
|
- `gtest` package has been updated past v1.13.0, which requires C++14 or higher.
|
||||||
|
|
||||||
- `services.vikunja` systemd service now uses `vikunja` as dynamic user instead of `vikunja-api`. Database users might need to be changed.
|
- `services.vikunja` systemd service now uses `vikunja` as dynamic user instead of `vikunja-api`. Database users might need to be changed.
|
||||||
|
|
||||||
- `services.vikunja.setupNginx` setting has been removed. Users now need to set up the webserver configuration on their own with a proxy pass to the vikunja service.
|
- `services.vikunja.setupNginx` setting has been removed. Users now need to set up the webserver configuration on their own with a proxy pass to the vikunja service.
|
||||||
|
Loading…
Reference in New Issue
Block a user