-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathandroid_plugin.dockerfile
51 lines (38 loc) · 1.61 KB
/
android_plugin.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# set android version.
ARG ANDROID_BUILD_TOOL_VERSION="build-tools;28.0.2"
ARG ANDROID_PLATFORM_VERSION="platforms;android-28"
FROM ubuntu:16.04
# install sudo
RUN apt-get update && apt-get -y install sudo \
&& useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
# install 32bit lib and zip
RUN sudo apt-get -y install lib32stdc++6 lib32z1 zip
# install java
RUN apt-get install -y software-properties-common curl \
&& add-apt-repository -y ppa:openjdk-r/ppa \
&& apt-get update \
&& apt-get install -y openjdk-8-jdk
# download gradle.
RUN cd /usr/local \
&& curl -L https://services.gradle.org/distributions/gradle-4.6-bin.zip -o gradle.zip \
&& unzip gradle.zip \
&& rm gradle.zip
# download Android SDK
RUN sudo apt-get -y install wget \
&& cd /usr/local \
&& wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip \
&& unzip sdk-tools-linux-4333796.zip \
&& rm -rf sdk-tools-linux-4333796.zip
# set env.
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV ANDROID_HOME /usr/local
ENV PATH /usr/local/gradle-4.6/bin:$PATH
ENV PATH /usr/local/tools/bin:$PATH
ENV PATH $ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH
RUN (while sleep 3; do echo "y"; done) | sdkmanager --update
RUN (while sleep 3; do echo "y"; done) | sdkmanager ${ANDROID_BUILD_TOOL_VERSION}
RUN (while sleep 3; do echo "y"; done) | sdkmanager "platform-tools" ${ANDROID_BUILD_TOOL_VERSION}
ARG PLUGIN
COPY project/$PLUGIN home/$PLUGIN
RUN cd home/$PLUGIN && gradle extractDebugAnnotations
ENTRYPOINT cd home/$PLUGIN && gradle assemble && cp build/outputs/aar/$PLUGIN-release.aar /home/output