Skip to content

Commit

Permalink
Code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingtoncosta committed Nov 16, 2017
1 parent 4bbc5e1 commit 33fceaf
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
language: android
jdk: oraclejdk8

env:
global:
- ANDROID_TARGET=android-23
- ANDROID_ABI=armeabi-v7a

android:
components:
- tools
- platform-tools
- build-tools-26.0.2
- android-26

- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}

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

script: ./gradlew build

script:
- ./gradlew build test jacocoTestReport

after_success:
- bash <(curl -s https://codecov.io/bash)
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ buildscript {
dependencies {
classpath deps.android.gradlePlugin
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
}
}

Expand Down
9 changes: 9 additions & 0 deletions convalida-validators/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'jacoco-android'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.WellingtonCosta'

Expand All @@ -15,3 +16,11 @@ dependencies {
implementation deps.support.design
testImplementation deps.junit
}

jacocoAndroidUnitTestReport {
excludes += ['**/AbstractValidator.*']

csv.enabled false
html.enabled true
xml.enabled true
}
12 changes: 12 additions & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'jacoco-android'

android {
compileSdkVersion versions.compileSdk
Expand All @@ -19,6 +20,9 @@ android {
}

buildTypes {
debug {
testCoverageEnabled true
}
release {
minifyEnabled true
}
Expand All @@ -42,4 +46,12 @@ dependencies {

androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

jacocoAndroidUnitTestReport {
excludes += ['**/*$*.class', '**/*$*.java']

csv.enabled false
html.enabled true
xml.enabled true
}

0 comments on commit 33fceaf

Please sign in to comment.