machine:
  environment:
    ADB_INSTALL_TIMEOUT: 100
    GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
  java:
    version: openjdk6
dependencies:
  pre:
    - mkdir $ANDROID_HOME/licenses
    - echo $ANDROID_SDK_LICENSE > $ANDROID_HOME/licenses/android-sdk-license
test:
  pre:
    - emulator -avd circleci-android22 -no-audio -no-window:
        background: true
        parallel: true
  override:
    - ./gradlew :classinjector:test :classinjector-android:testDebug :classinjector-android:assembleDebugAndroidTest
    - 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
    - ./gradlew :classinjector-android:connectedDebugAndroidTest
  post:
    - mkdir $CIRCLE_TEST_REPORTS/junit
    - find . -type f -regex ".*/build/test-results/.*xml" -exec cp -p {} $CIRCLE_TEST_REPORTS/junit \;
    - find . -type f -regex ".*/build/outputs/androidTest-results/.*xml" -exec cp -p {} $CIRCLE_TEST_REPORTS/junit \;

machine:
  environment:
    ADB_INSTALL_TIMEOUT: 100
    GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
  java:
    version: openjdk7
dependencies:
  pre:
    - mkdir $ANDROID_HOME/licenses
    - echo $ANDROID_SDK_LICENSE > $ANDROID_HOME/licenses/android-sdk-license
test:
  pre:
    - emulator -avd circleci-android22 -no-audio -no-window:
        background: true
        parallel: true
  override:
    - ./gradlew :classinjector:test :classinjector-android:testDebug :classinjector-android:assembleDebugAndroidTest
    - 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
    - ./gradlew :classinjector-android:connectedDebugAndroidTest
  post:
    - mkdir $CIRCLE_TEST_REPORTS/junit
    - find . -type f -regex ".*/build/test-results/.*xml" -exec cp -p {} $CIRCLE_TEST_REPORTS/junit \;
    - find . -type f -regex ".*/build/outputs/androidTest-results/.*xml" -exec cp -p {} $CIRCLE_TEST_REPORTS/junit \;

Use openjdk7 on Circle CI
Use openjdk7 on Circle CI
