add newly missing dependencies

Summary:public
- install the "pkg-config" and "ncurses-dev" apt packages
- install the android-22 target as the base image stopped shipping with it
- use more robust ways of installing opam depencies
- switch build command to `./build-infer.sh`
- switch android example to use gradlew instead of gradle because it complains
  about gradle-2.11 not being gradle-2.2

closes #291

Reviewed By: cristianoc

Differential Revision: D3000540

fb-gh-sync-id: f8bd44b
shipit-source-id: f8bd44b
master
Jules Villard 9 years ago committed by Facebook Github Bot 0
parent b62bdc46b6
commit 8e8b710556

@ -3,39 +3,40 @@ FROM heikomaass/android-sdk
MAINTAINER Infer MAINTAINER Infer
# Add build-tools-22 to the Android SDK # Add android-22 and build-tools-22 to the Android SDK
RUN ["/opt/sdk-tools/android-accept-licenses.sh", "android update sdk --filter \"build-tools-22.0.1\" --no-ui --force -a"] RUN ["/opt/sdk-tools/android-accept-licenses.sh", \
"android update sdk --filter \"android-22\" --no-ui --force --all"]
RUN ["/opt/sdk-tools/android-accept-licenses.sh", \
"android update sdk --filter \"build-tools-22.0.1\" --no-ui --force --all"]
# Debian config # Debian config
RUN add-apt-repository ppa:cwchien/gradle # to get a recent gradle
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
build-essential \ build-essential \
curl \ curl \
git \ git \
gradle \
groff \ groff \
libgmp-dev \ libgmp-dev \
libmpc-dev \ libmpc-dev \
libmpfr-dev \ libmpfr-dev \
m4 \ m4 \
ncurses-dev \
ocaml \ ocaml \
pkg-config \
python-software-properties \ python-software-properties \
rsync \ rsync \
software-properties-common \ software-properties-common \
unzip \ unzip \
zlib1g-dev zlib1g-dev
# Install a recent Gradle
RUN add-apt-repository ppa:cwchien/gradle
RUN apt-get update && \
apt-get install gradle-2.5
# Install OPAM # Install OPAM
RUN curl -sL \ RUN curl -sL \
https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux \ https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux \
-o /usr/local/bin/opam && \ -o /usr/local/bin/opam && \
chmod 755 /usr/local/bin/opam chmod 755 /usr/local/bin/opam
RUN opam init -y --comp=4.02.3 && \ RUN opam init -y --comp=4.02.3
opam install -y extlib.1.5.4 atdgen.1.6.0 javalib.2.3.1 sawja.1.5.1
# Download the latest Infer release # Download the latest Infer release
RUN INFER_VERSION=$(curl -s https://api.github.com/repos/facebook/infer/releases \ RUN INFER_VERSION=$(curl -s https://api.github.com/repos/facebook/infer/releases \
@ -49,11 +50,17 @@ RUN INFER_VERSION=$(curl -s https://api.github.com/repos/facebook/infer/releases
rm -f /infer && \ rm -f /infer && \
ln -s ${PWD}/infer-linux64-$INFER_VERSION /infer ln -s ${PWD}/infer-linux64-$INFER_VERSION /infer
# Install opam dependencies
RUN cd /infer && \
eval $(opam config env) && \
opam update && \
opam pin add --yes --no-action infer . && \
opam install --deps-only infer
# Compile Infer # Compile Infer
RUN cd /infer && \ RUN cd /infer && \
eval $(opam config env) && \ eval $(opam config env) && \
./configure && \ ./build-infer.sh
make -C infer clang java
# Install Infer # Install Infer
ENV INFER_HOME /infer/infer ENV INFER_HOME /infer/infer

@ -28,7 +28,7 @@ Infer.
# Build Infer; 20min or so; to be executed from docker/ in the Infer repo # Build Infer; 20min or so; to be executed from docker/ in the Infer repo
./run.sh ./run.sh
# you should now be inside the docker container with a shell prompt, e.g. # you should now be inside the docker container with a shell prompt, e.g.
# "root@5c3b9af90d59:/# " # "root@5c3b9af90d59:/infer/examples# "
cd infer/examples/android_hello/ cd android_hello/
infer -- gradle build infer -- ./gradlew build
``` ```

@ -48,4 +48,4 @@ fi
NAME="infer" NAME="infer"
docker build -t $NAME . && \ docker build -t $NAME . && \
docker run -it $NAME /bin/bash docker run -it $NAME /bin/bash -c 'cd /infer/examples/; exec /bin/bash'

Loading…
Cancel
Save