Fix android ci

This commit is contained in:
Marco A L Barbosa 2017-10-27 16:46:32 -02:00
parent 42b24bf704
commit a9115d5e4b
5 changed files with 20 additions and 32 deletions

View File

@ -1,15 +0,0 @@
#!/usr/bin/expect -f
# ignore-license
set timeout 1800
set cmd [lindex $argv 0]
set licenses [lindex $argv 1]
spawn {*}$cmd
expect {
"Do you accept the license '*'*" {
exp_send "y\r"
exp_continue
}
eof
}

View File

@ -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)
@ -47,11 +45,16 @@ case "$1" in
;;
esac;
filter="$filter,sys-img-$abi-android-24"
# --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"
./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
echo "no" |
./sdk/tools/bin/avdmanager create avd \
--name $1 \
--package "system-images;android-24;default;$abi"

View File

@ -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 \
@ -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 \"$@\"", \
"--" \

View File

@ -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 \
@ -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 \"$@\"", \
"--" \

View File

@ -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 \
@ -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 \"$@\"", \
"--" \