Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Java 8, Android command line tools and SDK for Ubuntu #188

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build_container/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ COPY ./build_container_ubuntu.sh /
RUN ./build_container_ubuntu.sh

ENV LANG en_US.utf8
ENV ANDROID_HOME /.android/sdk
ENV ANDROID_SDK_ROOT /.android/sdk
ENV ANDROID_NDK_HOME /.android/sdk/ndk/21.4.7075529
49 changes: 49 additions & 0 deletions build_container/build_container_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,55 @@ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
# TODO(phlax): use hashed requirements
pip3 install -U pyyaml virtualenv

function install_android_tools() {
#############
# Install JDK
#############

# Add Azul's public key
apt-key adv \
--keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 0xB1998361219BD9C9

# Download and install the package that adds
# the Azul APT repository to the list of sources
curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb

# Install the Java 8 JDK
apt-get install -y ./zulu-repo_1.0.0-3_all.deb
apt-get update -y
apt-get install -y zulu8-jdk
rm ./zulu-repo_1.0.0-3_all.deb

#######################
# Install Android tools
#######################

sdk_install_target="/.android"
android_home="$sdk_install_target/sdk"
phlax marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p "$android_home"
pushd "$sdk_install_target"

cmdline_file="commandlinetools-linux-7583922_latest.zip"
curl -OL "https://dl.google.com/android/repository/$cmdline_file"
unzip "$cmdline_file"
mkdir -p sdk/cmdline-tools/latest
mv cmdline-tools/* sdk/cmdline-tools/latest

sdkmanager=$android_home/cmdline-tools/latest/bin/sdkmanager
echo "y" | $sdkmanager --install "ndk;21.4.7075529"
phlax marked this conversation as resolved.
Show resolved Hide resolved
$sdkmanager --install "platforms;android-30"
$sdkmanager --install "build-tools;30.0.2"

popd
}

case $ARCH in
'x86_64' )
install_android_tools
;;
esac

source ./build_container_common.sh

# Soft link the gcc compiler (required by python env)
Expand Down