From 2b7c4ddfcceb828094a4fab5eebeb068152ea75d Mon Sep 17 00:00:00 2001 From: Eric Gribkoff Date: Sun, 23 Jul 2017 11:54:13 -0700 Subject: Install Android SDK tools in Dockerfile --- .../grpc_interop_android_java/Dockerfile.template | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'templates') diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_android_java/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_android_java/Dockerfile.template index 3f5b6cf6ce..1f6755eb51 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_android_java/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_android_java/Dockerfile.template @@ -57,22 +57,24 @@ apt-get update && apt-get install -y google-cloud-sdk && apt-get clean && ${'\\'} gcloud config set component_manager/disable_update_check true - # Download and install grpc-java + # Install Android SDK WORKDIR / - RUN git clone https://github.com/grpc/grpc-java.git - WORKDIR /grpc-java - RUN ./gradlew install + RUN mkdir android-sdk + WORKDIR android-sdk + RUN wget -q https://dl.google.com/android/repository/tools_r25.2.5-linux.zip && ${'\\'} + unzip -qq tools_r25.2.5-linux.zip && ${'\\'} + rm tools_r25.2.5-linux.zip && ${'\\'} + echo y | tools/bin/sdkmanager "platforms;android-22" && ${'\\'} + echo y | tools/bin/sdkmanager "build-tools;25.0.2" && ${'\\'} + echo y | tools/bin/sdkmanager "extras;android;m2repository" && ${'\\'} + echo y | tools/bin/sdkmanager "extras;google;google_play_services" && ${'\\'} + echo y | tools/bin/sdkmanager "extras;google;m2repository" && ${'\\'} + echo y | tools/bin/sdkmanager "patcher;v4" && ${'\\'} + echo y | tools/bin/sdkmanager "platform-tools" + ENV ANDROID_HOME "/android-sdk" - # Setup the Android SDK licenses - ENV ANDROID_HOME "/grpc-java/android-interop-testing/.android" - RUN mkdir -p "<%text>${ANDROID_HOME}/licenses" - RUN echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "<%text>${ANDROID_HOME}/licenses/android-sdk-license" - RUN echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "<%text>${ANDROID_HOME}/licenses/android-sdk-preview-license" - - # Build the Android interop apks - WORKDIR /grpc-java/android-interop-testing - RUN ../gradlew assembleDebug - RUN ../gradlew assembleDebugAndroidTest + # Reset the working directory + WORKDIR / # Define the default command. CMD ["bash"] -- cgit v1.2.3