Skip to content

Commit

Permalink
Reuse ENV variables from Dockerfile in build script
Browse files Browse the repository at this point in the history
Signed-off-by: JP Simard <[email protected]>
  • Loading branch information
jpsim committed Dec 8, 2022
1 parent 575433f commit 1a127b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 6 additions & 3 deletions build_container/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ ENV CLOUDSDK_PYTHON=python3
COPY ./build_container_common.sh /
COPY ./build_container_ubuntu.sh /

RUN ./build_container_ubuntu.sh

ENV LANG en_US.utf8
ENV ANDROID_SDK_INSTALL_TARGET /.android
ENV ANDROID_HOME /.android/sdk
ENV ANDROID_SDK_ROOT /.android/sdk
ENV ANDROID_NDK_VERSION 21.4.7075529
ENV ANDROID_NDK_HOME /.android/sdk/ndk/21.4.7075529

RUN ./build_container_ubuntu.sh

ENV LANG en_US.utf8
10 changes: 4 additions & 6 deletions build_container/build_container_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,17 @@ function install_android_tools() {
# Install Android tools
#######################

sdk_install_target="/.android"
android_home="$sdk_install_target/sdk"
mkdir -p "$android_home"
pushd "$sdk_install_target"
mkdir -p "$ANDROID_HOME"
pushd "$ANDROID_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"
sdkmanager=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager
echo "y" | $sdkmanager --install "ndk;$ANDROID_NDK_VERSION"
$sdkmanager --install "platforms;android-30"
$sdkmanager --install "build-tools;30.0.2"

Expand Down

0 comments on commit 1a127b2

Please sign in to comment.