From f0d2009b9ce576fe9820c2e77c5339d3a47105fd Mon Sep 17 00:00:00 2001 From: Iiro Krankka Date: Mon, 9 Jan 2017 12:52:38 +0200 Subject: [PATCH] Added Travis CI & Coveralls. --- .travis.yml | 21 +++++++++++++++++++++ app/build.gradle | 10 ++++++++++ build.gradle | 1 + 3 files changed, 32 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ee132a7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: android + +android: + components: + - tools + - platform-tools + - build-tools-25.0.0 + - android-25 + - extra-android-m2repository + +jdk: + oraclejdk8 + +before_script: + - echo no | android create avd --force -n test -t android-18 --abi armeabi-v7a + - emulator -avd test -no-audio -no-window & + - android-wait-for-emulator + - adb shell input keyevent 82 & + +script: + - ./gradlew createDebugCoverageReport coveralls \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index d53ae02..937bdb3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'com.github.kt3k.coveralls' android { compileSdkVersion 25 @@ -41,3 +42,12 @@ dependencies { compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support:recyclerview-v7:25.0.1' } + +coveralls { + jacocoReportPath = "${buildDir}/reports/coverage/debug/report.xml" +} + +tasks.coveralls { + dependsOn 'createDebugCoverageReport' + onlyIf { System.env.'CI' } +} diff --git a/build.gradle b/build.gradle index 53f4fad..38f4341 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.2.1' + classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files