forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rust-lang#456 from alexcrichton/cache-things
Share the host's `target` directory for tests
- Loading branch information
Showing
7 changed files
with
121 additions
and
9 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
FROM alexcrichton/rust-slave-android:2015-11-22 | ||
ENV CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \ | ||
PATH=$PATH:/rust/bin | ||
ENTRYPOINT ["sh"] | ||
FROM ubuntu:16.04 | ||
|
||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
file \ | ||
curl \ | ||
ca-certificates \ | ||
python \ | ||
unzip \ | ||
expect \ | ||
openjdk-9-jre \ | ||
libstdc++6:i386 \ | ||
gcc \ | ||
libc6-dev | ||
|
||
WORKDIR /android/ | ||
|
||
COPY install-ndk.sh /android/ | ||
RUN sh /android/install-ndk.sh | ||
|
||
ENV PATH=$PATH:/android/ndk-arm/bin:/android/sdk/tools:/android/sdk/platform-tools | ||
|
||
COPY install-sdk.sh accept-licenses.sh /android/ | ||
RUN sh /android/install-sdk.sh | ||
|
||
ENV PATH=$PATH:/rust/bin \ | ||
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \ | ||
ANDROID_EMULATOR_FORCE_32BIT=1 \ | ||
HOME=/tmp | ||
RUN chmod 755 /android/sdk/tools/* | ||
|
||
RUN cp -r /root/.android /tmp | ||
RUN chmod 777 -R /tmp/.android |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/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 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT | ||
# file at the top-level directory of this distribution and at | ||
# http://rust-lang.org/COPYRIGHT. | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
set -ex | ||
|
||
curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip | ||
unzip -q android-ndk-r13b-linux-x86_64.zip | ||
android-ndk-r13b/build/tools/make_standalone_toolchain.py \ | ||
--install-dir /android/ndk-arm \ | ||
--arch arm \ | ||
--api 24 | ||
|
||
rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT | ||
# file at the top-level directory of this distribution and at | ||
# http://rust-lang.org/COPYRIGHT. | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
set -ex | ||
|
||
# Prep the SDK and emulator | ||
# | ||
# Note that the update process requires that we accept a bunch of licenses, and | ||
# we can't just pipe `yes` into it for some reason, so we take the same strategy | ||
# located in https://github.com/appunite/docker by just wrapping it in a script | ||
# which apparently magically accepts the licenses. | ||
|
||
mkdir sdk | ||
curl https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz | \ | ||
tar xzf - -C sdk --strip-components=1 | ||
|
||
filter="platform-tools,android-21" | ||
filter="$filter,sys-img-armeabi-v7a-android-21" | ||
|
||
./accept-licenses.sh "android - update sdk -a --no-ui --filter $filter" | ||
|
||
echo "no" | android create avd \ | ||
--name arm-21 \ | ||
--target android-21 \ | ||
--abi armeabi-v7a |
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
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