Updating libs/scripts to require Java 11

This commit is contained in:
Ben Dean-Kawamura 2021-07-28 14:50:40 -04:00 коммит произвёл bendk
Родитель c51b63595a
Коммит 07a7f542c3
3 изменённых файлов: 17 добавлений и 13 удалений

Просмотреть файл

@ -74,8 +74,8 @@ The instructions here assume that you are building for Fenix in order test your
1. Install Android SDK, JAVA, NDK and set required env vars
1. Clone the [Fenix](https://github.com/mozilla-mobile/fenix/) repository (not in a-s)
1. Clone the [android-components](https://github.com/mozilla-mobile/android-components/) repository (not in a-s)
1. Install [Java **8**] for your system
1. Set `JAVA_HOME` to point to the JDK 8 installation directory.
1. Install [Java **11**] for your system
1. Set `JAVA_HOME` to point to the JDK 11 installation directory.
1. Download and install [Android Studio](https://developer.android.com/studio/#downloads)
1. Set `ANDROID_SDK_ROOT` and `ANDROID_HOME` to the Android Studio sdk location and add it to your rc file.
1. Configure the required versions of NDK

Просмотреть файл

@ -53,14 +53,14 @@ location of your Java installation."
fi
JAVA_VERSION=$("$JAVACMD" -version 2>&1 | grep -i version | cut -d'"' -f2 | cut -d'.' -f1-2)
if [[ "${JAVA_VERSION}" != "1.8" ]]; then
echo "Incompatible java version: ${JAVA_VERSION}. JDK 8 must be installed."
echo "Try switching versions and re-running. Using sdkman: sdk install java 8.0.282+8.hs-adpt || sdk use java 8.0.282+8.hs-adpt"
if [[ "${JAVA_VERSION}" != "11.0" ]]; then
echo "Incompatible java version: ${JAVA_VERSION}. JDK 11 must be installed."
echo "Try switching versions and re-running. Using sdkman: sdk install java 11.0.3.hs-adpt || sdk use 11.0.3.hs-adpt"
exit 1
fi
# NDK ez-install
"$ANDROID_HOME/tools/bin/sdkmanager" "ndk;$(./gradlew -q printNdkVersion | tail -1)"
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;$(./gradlew -q printNdkVersion | tail -1)"
# CI just downloads these libs anyway.
if [[ -z "${CI}" ]]; then

Просмотреть файл

@ -20,9 +20,9 @@ WORKDIR /builds/worker/
# Configuration
ENV ANDROID_BUILD_TOOLS "28.0.3"
ENV ANDROID_SDK_VERSION "3859397"
ENV ANDROID_PLATFORM_VERSION "28"
ENV ANDROID_BUILD_TOOLS "30.0.3"
ENV ANDROID_PLATFORM_VERSION "30"
ENV ANDROID_NDK_VERSION "21.3.6528147"
# Set up the language variables to avoid problems (we run locale-gen later).
ENV LANG en_US.UTF-8
@ -51,7 +51,7 @@ RUN apt-get update -qq \
# If you add anything below, please update building.md.
####################
# Android builds
openjdk-8-jdk \
openjdk-11-jdk \
# Required by gyp but also CI scripts.
python3 \
# libs/ source patching.
@ -110,10 +110,14 @@ WORKDIR /builds/worker
ENV ANDROID_HOME /builds/worker/android-sdk
ENV ANDROID_SDK_HOME /builds/worker/android-sdk
ENV PATH ${PATH}:${ANDROID_SDK_HOME}/tools:${ANDROID_SDK_HOME}/tools/bin:${ANDROID_SDK_HOME}/platform-tools:/opt/tools:${ANDROID_SDK_HOME}/build-tools/${ANDROID_BUILD_TOOLS}
ENV PATH ${PATH}:${ANDROID_SDK_HOME}/cmdline-tools/latest/bin:${ANDROID_SDK_HOME}/platform-tools:/opt/tools:${ANDROID_SDK_HOME}/build-tools/${ANDROID_BUILD_TOOLS}
RUN curl -sfSL --retry 5 --retry-delay 10 https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip > sdk.zip \
&& unzip -q sdk.zip -d ${ANDROID_SDK_HOME} \
# Download the Android SDK tools, unzip them to ${ANDROID_SDK_HOME}/cmdline-tools/latest/, accept all licenses
# The download link comes from https://developer.android.com/studio/#downloads
RUN curl -sfSL --retry 5 --retry-delay 10 https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip > sdk.zip \
&& unzip -q sdk.zip \
&& mkdir $ANDROID_SDK_HOME/cmdline-tools \
&& mv cmdline-tools $ANDROID_HOME/cmdline-tools/latest \
&& rm sdk.zip \
&& mkdir -p /builds/worker/android-sdk/.android/ \
&& touch /builds/worker/android-sdk/.android/repositories.cfg \