@@ -12,7 +12,7 @@ The following software is installed onto the Android CI VM for builds:
- GoLang (version 1.17.5)
- Java OpenJDK 8
- Android SDK Tools (version 3859397)
- Android SDK Tools (version 7583922)
- Android platform SDK (version 25)
- Android platform SDK (version 29)
- Android platform SDK (version 30)
...
...
@@ -30,11 +30,15 @@ Additionally, the following tools are explicitly installed:
Software not on the above lists may be available, but cannot be relied upon if Ubuntu removes them from the base install in a future update.
## Migrating to the new SDK version
Renaming the `$ANDROID_HOME` environment variable to be `$ANDROID_SDK_ROOT` is required for tools to find the SDK. `$ANDROID_HOME` is deprecated ([see here for more details](https://developer.android.com/studio/command-line/variables)).
## Using the Android CI
You need to tag the builds that need the Android tooling in your `.gitlab-ci.yml` file with the `android` tag. (If you're unfamiliar with what a `.gitlab-ci.yml` file is, [GitLab describes it here.](https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html)) An example is below. This should only be done for jobs where the Android SDK tools are directly required, as job capacity is very limited.
When using the `android` tag, you need to ensure that `/android-sdk/platform-tools/` is in your `$PATH` environment variable, as well as setting the `$ANDROID_HOME` environment variable to `/android-sdk`. Both of these can be done in a `before_script` if you have multiple jobs that use the `android` tag, or done in the `script` part of your job for just one.
When using the `android` tag, you need to ensure that `/android-sdk/platform-tools/` is in your `$PATH` environment variable, as well as setting the `$ANDROID_SDK_ROOT` environment variable to `/android-sdk`. Both of these can be done in a `before_script` if you have multiple jobs that use the `android` tag, or done in the `script` part of your job for just one.
You may optionally want to add `/usr/local/go/bin` to your `$PATH` if you plan to build Go programs for Android in your job, such as building client bindings.
...
...
@@ -43,7 +47,7 @@ stages:
-build
before_script:
-export ANDROID_HOME=/android-sdk
-export ANDROID_SDK_ROOT=/android-sdk
-export PATH=/android-sdk/platform-tools/:$PATH
app-build:
...
...
@@ -74,32 +78,30 @@ set -e
# --- System ---
# Firewall
sudo apt-get install-y ufw
sudo apt-get install-y ufw fail2ban
sudo ufw allow ssh
sudo ufw enable
# Fail2Ban
sudo apt-get install-y fail2ban
# --- Java ---
sudo apt-get install-y openjdk-8-jdk-headless
# --- Android SDK ---
sudo apt-get install-y wget tar unzip lib32stdc++6 lib32z1