Last active
February 27, 2017 07:34
-
-
Save lukaville/0eb7e57d1d60b6c071bc23d781c5bd3b to your computer and use it in GitHub Desktop.
Android Studio Inspector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:xenial | |
ENV ANDROID_SDK_URL https://dl.google.com/android/repository/tools_r25.2.3-linux.zip | |
ENV STUDIO_DOWNLOAD_URL https://dl.google.com/dl/android/studio/ide-zips/2.2.3.0/android-studio-ide-145.3537739-linux.zip | |
ENV KOTLIN_PLUGIN_URL https://plugins.jetbrains.com/files/6954/31110/kotlin-plugin-1.0.5-release-Studio2.2-3.zip | |
ENV INSPECTOR_PLUGIN_URL https://github.com/lukaville/android-studio-inspector-plugin/releases/download/v0.2/android-studio-inspector-plugin.jar | |
ENV IDEA_INSPECTOR_VERSION 0e37430 | |
ENV ANDROID_VERSION 25 | |
ENV GROOVY_VERSION 2.4.8 | |
RUN apt-get update | |
# Install requirements | |
RUN apt-get install -y openjdk-8-jdk xvfb lib32z1 lib32ncurses5 lib32stdc++6 git vim ant wget unzip | |
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd64/ | |
RUN apt-get clean | |
RUN apt-get purge | |
# Android Studio | |
RUN wget $STUDIO_DOWNLOAD_URL -O /tmp/studio.zip && unzip -d /opt /tmp/studio.zip && rm /tmp/studio.zip | |
RUN wget $KOTLIN_PLUGIN_URL -O /tmp/kotlin.zip && unzip -d /opt/android-studio/plugins /tmp/kotlin.zip && rm /tmp/kotlin.zip | |
RUN wget $INSPECTOR_PLUGIN_URL -O /opt/android-studio/plugins/android-studio-inspector.jar | |
# Android SDK | |
RUN wget $ANDROID_SDK_URL -O android-sdk.zip && \ | |
unzip android-sdk.zip -d /opt/android-sdk && \ | |
rm -f android-sdk.zip | |
ENV ANDROID_HOME /opt/android-sdk/ | |
ENV PATH ${PATH}:${ANDROID_HOME}/tools/:${ANDROID_HOME}/platform-tools | |
RUN echo "y" | android update sdk --all --no-ui --filter "platform-tools,android-$ANDROID_VERSION" | |
# Groovy | |
RUN wget https://dl.bintray.com/groovy/maven/apache-groovy-binary-${GROOVY_VERSION}.zip -O groovy.zip && \ | |
mkdir -p /opt/groovy && \ | |
unzip groovy.zip -d /opt/groovy && \ | |
ln -s /opt/groovy/groovy-${GROOVY_VERSION} /opt/groovy/current && \ | |
rm groovy.zip | |
ENV PATH $PATH:/opt/groovy/current/bin | |
# IDEA CLI inspector | |
RUN git clone https://github.com/bentolor/idea-cli-inspector.git idea-cli-inspector && \ | |
cd idea-cli-inspector && \ | |
git reset --hard $IDEA_INSPECTOR_VERSION | |
COPY run_inspections.sh / | |
ENTRYPOINT ["/run_inspections.sh"] | |
# ENTRYPOINT ["groovy", "idea-cli-inspector/ideainspect.groovy", "--ideahome", "/opt/android-studio", "--rootdir", "/project"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Start fake display | |
XVFB_WHD=${XVFB_WHD:-1280x720x16} | |
Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp & | |
xvfb=$! | |
rm -rf /opt/android-studio/plugins/android-studio-inspector.jar | |
# export DISPLAY=192.168.1.38:0 | |
export DISPLAY=:99 | |
# Create empty settings directory to ignore import settings dialog | |
mkdir /opt/android-studio/config | |
printf "idea.config.path=/opt/android-studio/config\n" >> /opt/android-studio/bin/idea.properties | |
printf "plugin.android_studio_inspector.inspections_directory=/project/output/\n" >> /opt/android-studio/bin/idea.properties | |
/opt/android-studio/bin/studio.sh /project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment