Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update travis setup #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 19 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
language: java
jdk: oraclejdk7
env: ANDROID_SDK=android-16 ANDROID_ABI=armeabi-v7a
language: android
android:
components:
# The SDK version used to compile your project
- $ANDROID_SDK

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

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

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

# Install required Android components
- android list sdk --extended
# Do you accept the license 'android-sdk-license-bcbbd656' [y/n]:
- echo -ne "y\n" | android update sdk --filter system-image,platform-tools,extra-android-support,$ANDROID_SDK --no-ui --force

# Create and start emulator
before_script:
- echo no | android create avd --force -n test -t $ANDROID_SDK --abi $ANDROID_ABI
- android list avds
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- mvn --version

before_script:
# Make sure the emulator has started before running tests
- chmod +x ./wait_for_emulator
- ./wait_for_emulator

script:
- mvn clean install -e
script: mvn clean install
25 changes: 25 additions & 0 deletions android-wait-for-emulator
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain

set +e

bootanim=""
failcounter=0
timeout_in_sec=360

until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
|| "$bootanim" =~ "running" ]]; then
let "failcounter += 1"
echo "Waiting for emulator to start"
if [[ $failcounter -gt timeout_in_sec ]]; then
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
exit 1
fi
fi
sleep 1
done

echo "Emulator is ready"
18 changes: 0 additions & 18 deletions wait_for_emulator

This file was deleted.