language: android
android:
  components:
    - tools
    - platform-tools
    - build-tools-24.0.3
    - android-24
    - doc-24
    - extra-android-m2repository
    - sys-img-armeabi-v7a-android-24
jdk:
  - oraclejdk8
before_cache:
  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
before_script:
  - echo no | android create avd --force -n test -t android-24 --abi default/armeabi-v7a
  - emulator -avd test -no-audio -no-window &
  - android-wait-for-emulator
  - adb shell input keyevent 82 &
script:
  - ./gradlew testAllModules
  - if [ [ [ "$TRAVIS_BRANCH" == "beta" ] || [ "$TRAVIS_BRANCH" == "master" ] ] && [! "$TRAVIS_TAG"] ]; then ./gradlew ship; fi

language: android
android:
  components:
    - tools
    - platform-tools
    - build-tools-24.0.3
    - android-24
    - doc-24
    - extra-android-m2repository
    - sys-img-armeabi-v7a-android-24
jdk:
  - oraclejdk8
before_cache:
  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
before_script:
  - echo no | android create avd --force -n test -t android-24 --abi default/armeabi-v7a
  - emulator -avd test -no-audio -no-window &
  - android-wait-for-emulator
  - adb shell input keyevent 82 &
script:
  - ./gradlew testAllModules
  - if [ [ [ "$TRAVIS_BRANCH" == "beta" ] || [ "$TRAVIS_BRANCH" == "master" ] ] && [ -z "$TRAVIS_TAG"] ]; then ./gradlew ship; fi

Use -z instead of exclaimation point
Use -z instead of exclaimation point
