Skip to content

Commit

Permalink
Travis: Run with Google Play Services for Voice Recognition
Browse files Browse the repository at this point in the history
Getting the Voice recognition running is only possible, if at least one
handler handles the RecognitionService.SERVICE_INTERFACE intent. The
easiest way to achive this is to run the instrumented test on an emulator
which actually has the Google Play services installed.

This commit changes the travis-ci configuration so that the emulator
started has the Play services installed. It also adds some extras, which
are already pre-installed, but accoridng to the travis documentation[1]
should be explicitly mentioned to ensure build stability. However, for the
current build they don't change anything. The extras are namely:

extra-android-support
extra-google-google_play_services
extra-google-m2repository
extra-android-m2repository

For some reason, also the -no-audio switch does not work anymore, however,
currently there's no need to completely disable audio in our build and
test.

[1]
https://docs.travis-ci.com/user/languages/android/#Pre-installed-components

Signed-off-by: Florian <[email protected]>
  • Loading branch information
FlorianSW committed Jan 5, 2018
1 parent 0f05993 commit 1f68750
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ android:
- platform-tools
- tools
- android-22
- sys-img-armeabi-v7a-android-22

- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
- addon-google_apis-google-22 # Google play services
- sys-img-armeabi-v7a-google_apis-22

licenses:
- android-sdk-license-.+
- google-gdk-license-.+

install:
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
Expand All @@ -35,11 +44,11 @@ install:
# Emulator Management: Create, Start and Wait
before_script:
- android list device
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a -d "5.4in FWVGA"
- emulator -avd test -no-audio -no-window &
- android list target
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a --tag google_apis -d "5.4in FWVGA"
- emulator -avd test -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- android list target

script:
- ./gradlew build connectedCheck test jacocoTestReport
Expand Down

0 comments on commit 1f68750

Please sign in to comment.