machine:
   environment:
     ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
 pre:
   - echo y | android update sdk --no-ui --all --filter "tools,platform-tools,android-23"
   - echo y | android update sdk --no-ui --all --filter "build-tools-23.0.3"
   - echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
   - chmod +x gradlew

test:
  pre:
    - android list targets
    - echo no | android create avd -n emulatorwithgoogleapi22 -t 9 --abi google_apis/armeabi-v7a
    - echo 'vm.heapSize=512' >> ~/.android/avd/emulatorwithgoogleapi22.ini
    - echo 'hw.ramSize=1024' >> ~/.android/avd/emulatorwithgoogleapi22.ini
    - cat ~/.android/avd/emulatorwithgoogleapi22.ini
    - emulator -avd emulatorwithgoogleapi22 -no-audio -no-window :
        background: true
        parallel: true
    - circle-android wait-for-boot
    - adb shell input keyevent 82
    - adb shell svc power stayon true
    - adb shell settings put global window_animation_scale 0
    - adb shell settings put global transition_animation_scale 0
    - adb shell settings put global animator_duration_scale 0

  override:
    - ./gradlew createDebugCoverageReport
    - ./gradlew test

  post:
    - cp -r app/build/outputs $CIRCLE_ARTIFACTS
    - cp -r app/build/outputs/androidTest-results/ $CIRCLE_TEST_REPORTS
    - cp -r app/build/reports/coverage/ $CIRCLE_TEST_REPORTS
    - cp -r app/build/test-results/debug/ $CIRCLE_TEST_REPORTS

machine:
   environment:
     ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
 pre:
   - echo y | android update sdk --no-ui --all --filter "tools,platform-tools,android-23"
   - echo y | android update sdk --no-ui --all --filter "build-tools-23.0.3"
   - echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
   - chmod +x gradlew

test:
  override:
    - ./gradlew createDebugCoverageReport
    - ./gradlew test

  post:
    - cp -r app/build/outputs $CIRCLE_ARTIFACTS
    - cp -r app/build/outputs/androidTest-results/ $CIRCLE_TEST_REPORTS
    - cp -r app/build/reports/coverage/ $CIRCLE_TEST_REPORTS
    - cp -r app/build/test-results/debug/ $CIRCLE_TEST_REPORTS

Remove emulator from CircleCI for now
Remove emulator from CircleCI for now
