Skip to content

Commit

Permalink
Fix android ci
Browse files Browse the repository at this point in the history
  • Loading branch information
malbarbo committed Oct 27, 2017
1 parent 42b24bf commit a9115d5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 33 deletions.
15 changes: 0 additions & 15 deletions ci/android-accept-licenses.sh

This file was deleted.

27 changes: 15 additions & 12 deletions ci/android-install-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ set -ex
# which apparently magically accepts the licenses.

mkdir sdk
curl https://dl.google.com/android/repository/tools_r25.2.5-linux.zip -O
unzip -d sdk tools_r25.2.5-linux.zip

filter="platform-tools,android-24"
curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O
unzip -d sdk sdk-tools-linux-3859397.zip

case "$1" in
arm | armv7)
Expand All @@ -47,11 +45,16 @@ case "$1" in
;;
esac;

filter="$filter,sys-img-$abi-android-24"

./android-accept-licenses.sh "android - update sdk -a --no-ui --filter $filter --no-https"

echo "no" | android create avd \
--name $1 \
--target android-24 \
--abi $abi
# --no_https avoids
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
echo "yes" | \
./sdk/tools/bin/sdkmanager --no_https \
"emulator" \
"platform-tools" \
"platforms;android-24" \
"system-images;android-24;default;$abi"

echo "no" |
./sdk/tools/bin/avdmanager create avd \
--name $1 \
--package "system-images;android-24;default;$abi"
4 changes: 2 additions & 2 deletions ci/docker/aarch64-linux-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*

ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
Expand All @@ -38,7 +38,7 @@ ENTRYPOINT [ \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash emulator @aarch64 -no-window & \
"SHELL=/bin/dash /android/sdk/emulator/emulator @aarch64 -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/arm-linux-androideabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*

ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
Expand All @@ -38,7 +38,7 @@ ENTRYPOINT [ \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash emulator @arm -no-window & \
"SHELL=/bin/dash /android/sdk/emulator/emulator @arm -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/i686-linux-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*

ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
Expand All @@ -38,7 +38,7 @@ ENTRYPOINT [ \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash emulator @i686 -no-window -no-accel & \
"SHELL=/bin/dash /android/sdk/emulator/emulator @i686 -no-window -no-accel & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
Expand Down

0 comments on commit a9115d5

Please sign in to comment.