Skip to content

Commit 8d35133

Browse files
author
jlhonora
committed
Update travis setup
1 parent 08c6335 commit 8d35133

File tree

3 files changed

+44
-49
lines changed

3 files changed

+44
-49
lines changed

.travis.yml

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
1-
language: java
2-
jdk: oraclejdk7
31
env: ANDROID_SDK=android-16 ANDROID_ABI=armeabi-v7a
2+
language: android
3+
android:
4+
components:
5+
# The SDK version used to compile your project
6+
- $ANDROID_SDK
47

5-
before_install:
6-
# Install ia32-libs (necessary for Android SDK to run on 64-bit linux)
7-
# - sudo apt-get clean && sudo apt-get update
8-
- sudo apt-get update -qq
9-
- sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch
8+
# Additional components
9+
- extra-google-m2repository
10+
- extra-android-m2repository
11+
- extra-android-support
1012

11-
# Install Android SDK
12-
- wget http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz
13-
- tar -zxf android-sdk_r22.6.2-linux.tgz
14-
- ls
15-
- export ANDROID_HOME=`pwd`/android-sdk-linux
16-
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
13+
# Specify at least one system image,
14+
# if you need to run emulator(s) during your tests
15+
- sys-img-$ANDROID_ABI-$ANDROID_SDK
1716

18-
# Install build-tools
19-
- wget https://dl-ssl.google.com/android/repository/build-tools_r19.0.3-linux.zip
20-
- unzip build-tools_r19.0.3-linux.zip -d $ANDROID_HOME
21-
- mkdir -p $ANDROID_HOME/build-tools/
22-
- mv $ANDROID_HOME/android-4.4.2 $ANDROID_HOME/build-tools/19.0.1
17+
licenses:
18+
- 'android-sdk-license-.+'
2319

24-
# Install required Android components
25-
- android list sdk --extended
26-
# Do you accept the license 'android-sdk-license-bcbbd656' [y/n]:
27-
- echo -ne "y\n" | android update sdk --filter system-image,platform-tools,extra-android-support,$ANDROID_SDK --no-ui --force
28-
29-
# Create and start emulator
20+
before_script:
3021
- echo no | android create avd --force -n test -t $ANDROID_SDK --abi $ANDROID_ABI
3122
- android list avds
3223
- emulator -avd test -no-skin -no-audio -no-window &
24+
- android-wait-for-emulator
25+
- adb shell input keyevent 82 &
26+
- mvn --version
3327

34-
before_script:
35-
# Make sure the emulator has started before running tests
36-
- chmod +x ./wait_for_emulator
37-
- ./wait_for_emulator
38-
39-
script:
40-
- mvn clean install -e
28+
script: mvn clean install

android-wait-for-emulator

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Originally written by Ralf Kistner <[email protected]>, but placed in the public domain
4+
5+
set +e
6+
7+
bootanim=""
8+
failcounter=0
9+
timeout_in_sec=360
10+
11+
until [[ "$bootanim" =~ "stopped" ]]; do
12+
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
13+
if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
14+
|| "$bootanim" =~ "running" ]]; then
15+
let "failcounter += 1"
16+
echo "Waiting for emulator to start"
17+
if [[ $failcounter -gt timeout_in_sec ]]; then
18+
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
19+
exit 1
20+
fi
21+
fi
22+
sleep 1
23+
done
24+
25+
echo "Emulator is ready"

wait_for_emulator

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)