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

machine:
  environment:
    ANDROID_HOME: /usr/local/android-sdk-linux
  java:
    version: oraclejdk8

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

Set OpenJDK 8 on CircleCI
Set OpenJDK 8 on CircleCI
