diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..60c0980 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,46 @@ +language: android +dist: trusty + +env: + global: + - ANDROID_TARGET=android-28 + - ANDROID_ABI=armeabi-v7a + - CODECOV_TOKEN=52bcf07f-611f-47cc-81f5-e86d77d6fcb7 + +android: + components: + - android-28 + - tools + - platform-tools + - build-tools-28.0.0 + - extra-android-m2repository + - extra-android-m2repository + - extra-google-google_play_services + - $ANDROID_TARGET + - sys-img-${ANDROID_ABI}-${ANDROID_TARGET} + +licenses: + - 'android-sdk-license-.+' + +script: + - ./gradlew build jacocoTestReport + +before_install: + - chmod +x gradlew + - yes | sdkmanager "platforms;android-28" + - yes | sdkmanager --update + +after_success: + - bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} + +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ + +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + - $HOME/.android/build-cache + + diff --git a/README.md b/README.md index 52259b2..f0b72ff 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Build Status](https://travis-ci.com/sayamss/offix-android.svg?branch=codecov)](https://travis-ci.com/sayamss/offix-android) +[![codecov](https://codecov.io/gh/sayamss/offix-android/branch/codecov/graph/badge.svg)](https://codecov.io/gh/sayamss/offix-android) +


diff --git a/sample/build.gradle b/sample/build.gradle index 0bb25da..7d887cb 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -7,6 +7,18 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android-extensions' +// Jacoco Plugin +apply plugin: 'jacoco-android' + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4' + } +} + android { compileSdkVersion 28