Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
coverage:
precision: 2
round: down
range: "30...45"
status:
patch: yes
changes: no

comment:
layout: "header, diff, changes, tree"
behavior: default

ignore:
- "tst/*" # ignore test harness code
- "tst/**/*" # ignore test harness code
- '**/R.class'
- '**/R$*.class'
- '**/BuildConfig.*'
- '**/Manifest*.*'
- '**/*Test*.*'
- 'android/**/*.*'
- '**/R2.class'
- '**/R2$*.class'
- '**/*_ViewBinding*.*'
- '**/*Dagger*Component*.*'
- '**/*Module.*'
- '**/*Module$*.*'
- '**/*Module_Proxy.*'
- '**/*MembersInjector*.*'
- '**/*_Factory*.*'
- '**/*Provide*Factory*.*'
- '**/*Factory.*'
- '**/*Activity.*'
- '**/App.class'
- '**/*Adapter.*'
- '**/*ViewHolder*.*'
- '**/api/response/*.*'
- '**/data/model/*.*'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.DS_Store
/build
/captures
*.exec
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,6 @@ notifications:
urls:
- https://webhooks.gitter.im/e/1b633ac4f7ea6fa35dd1
on_success: change
on_failure: always
on_failure: always
after_success:
- bash <(curl -s https://codecov.io/bash)
54 changes: 54 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'org.jacoco:org.jacoco.core:0.8.5'
classpath 'org.neotech.plugin:android-root-coverage-plugin:1.2.0'
}
}


apply plugin: 'jacoco'
jacoco { toolVersion = '0.8.5' }

apply plugin: 'org.neotech.plugin.rootcoverage'

allprojects {
repositories {
jcenter()
Expand All @@ -21,3 +29,49 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}

rootCoverage {
buildVariant "debug"
// buildVariantOverrides ":driver" : "mockDebug"

// Class exclude patterns
excludes = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'android/**/*.*',

//Butterknife hack for multi-modules poroject
'**/R2.class',
'**/R2$*.class',
'**/*_ViewBinding*.*',

//Dagger 2
'**/*Dagger*Component*.*',
'**/*Module.*',
'**/*Module$*.*',
'**/*Module_Proxy.*',
'**/*MembersInjector*.*',
'**/*_Factory*.*',
'**/*Provide*Factory*.*',

//Autofactory
'**/*Factory.*',

//Classes I intentionally don't want to test
'**/*Activity.*',
'**/App.class',
'**/*Adapter.*',
'**/*ViewHolder*.*',
'**/api/response/*.*',
'**/data/model/*.*',
]
executeTests true
executeAndroidTests false
executeUnitTests true
generateXml true
includeAndroidTestResults false
includeUnitTestResults true
}
2 changes: 1 addition & 1 deletion data/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply from: "$rootDir/gradle/android_common.gradle"

dependencies {
def dataDependencies = rootProject.ext.dataDependencies
def dataTestDependencies = rootProject.ext.dataTestDependencies
Expand Down
1 change: 1 addition & 0 deletions domain/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apply plugin: 'com.android.library'
apply from: "$rootDir/gradle/android_common.gradle"
dependencies {
def domainDependencies = rootProject.ext.domainDependencies
Expand Down
14 changes: 13 additions & 1 deletion gradle/android_common.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'jacoco'
jacoco { toolVersion = '0.8.5' }

android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
Expand All @@ -12,6 +13,9 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
testCoverageEnabled true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Expand All @@ -24,4 +28,12 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
animationsDisabled true
unitTests {
includeAndroidResources = true
}
}
}
9 changes: 1 addition & 8 deletions presentation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
apply plugin: 'com.android.application'

apply from: "$rootDir/gradle/android_common.gradle"
android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
buildToolsVersion rootProject.ext.androidBuildToolsVersion

defaultConfig {
applicationId 'com.jordifierro.androidbase.presentation'
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode rootProject.ext.appVersionCode
versionName rootProject.ext.appVersionName
testInstrumentationRunner 'com.jordifierro.androidbase.presentation.TestMockerRunner'
}
compileOptions {
Expand Down