Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Coveralls Integration (#101)
Browse files Browse the repository at this point in the history
* Add test coverage reporting to Travis using Coveralls
* Add Coverall badge to README
  • Loading branch information
bobheadxi committed Jul 5, 2017
1 parent 0ad748f commit 6996d5e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
notifications:
email: false

env:
matrix:
- API=android-21 ABI=armeabi-v7a

language: android
jdk:
- oraclejdk8
Expand All @@ -11,6 +16,7 @@ android:
- android-25
- extra-google-m2repository
- extra-android-m2repository
- sys-img-armeabi-v7a-android-21
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
Expand All @@ -19,5 +25,11 @@ android:
before_install:
- chmod +x gradlew

before_script:
- echo no | android create avd --force -n test -t $API --abi $ABI
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &

script:
- ./gradlew clean assemble test
- ./gradlew clean assemble test connectedAndroidTest coveralls
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /r/Android App Store
[![Project License](https://img.shields.io/badge/license-Apache--2.0-blue.svg?style=flat-square)](LICENSE)
[![Build Status](https://travis-ci.org/d4rken/reddit-android-appstore.svg?branch=dev)](https://travis-ci.org/d4rken/reddit-android-appstore)
[![Build Status](https://travis-ci.org/d4rken/reddit-android-appstore.svg?branch=dev)](https://travis-ci.org/d4rken/reddit-android-appstore) [![Coverage Status](https://coveralls.io/repos/github/d4rken/reddit-android-appstore/badge.svg)](https://coveralls.io/github/d4rken/reddit-android-appstore)

App inspired by [this reddit post](https://redd.it/50rafp)

Expand Down
18 changes: 18 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'realm-android'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: "jacoco"

def gitSha() {
def p = 'git rev-parse --short HEAD'.execute([], project.rootDir)
Expand Down Expand Up @@ -49,6 +51,7 @@ android {
debug {
minifyEnabled false
useProguard false
if (System.env.'CI') testCoverageEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Expand Down Expand Up @@ -101,6 +104,21 @@ android {
}
}

coveralls {
sourceDirs = fileTree(dir: "${project.projectDir}/java", excludes: [
'**/*_MembersInjector.class',
'**/Dagger*Component.class',
'**/Dagger*Component$Builder.class',
'**/*Module_*Factory.class'
]).flatten()
jacocoReportPath = "${buildDir}/reports/coverage/prod/debug/report.xml"
}

tasks.coveralls {
dependsOn 'connectedAndroidTest', 'test'
onlyIf { System.env.'CI' }
}

tasks.withType(Test) {
systemProperty "robolectric.logging", "stdout"
}
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "io.realm:realm-gradle-plugin:1.2.0"
classpath 'me.tatarka:gradle-retrolambda:3.3.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
}
}

Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit 6996d5e

Please sign in to comment.