Skip to content

Commit

Permalink
#Added#
Browse files Browse the repository at this point in the history
Unit test coverage
  • Loading branch information
hui.zhao committed Feb 9, 2020
1 parent 5dfbc03 commit ea83ff5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install:
- sdkmanager --list || true

script:
- ./gradlew clean build test
- ./gradlew clean build jacocoTestReport
- ./gradlew assembleRelease

notifications:
Expand All @@ -50,4 +50,4 @@ deploy:
branch: master

after_success:
- echo I am done, release url:https://github.com/Kyson/AndroidGodEye/releases
- bash <(curl -s https://codecov.io/bash) && echo I am done, Release url:https://github.com/Kyson/AndroidGodEye/releases and CodeCov:https://codecov.io/gh/Kyson/AndroidGodEye
2 changes: 2 additions & 0 deletions android-godeye/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'

apply from: rootProject.file('gradle/gradle-jacoco-support.gradle')

android {
compileSdkVersion Integer.parseInt(COMPILE_SDK_VERSION)
buildToolsVersion BUILD_TOOLS_VERSION
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.novoda:bintray-release:0.9.1'
classpath "cn.hikyson.methodcanary:plugin:0.12.1"
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4'
}
}

Expand Down
9 changes: 9 additions & 0 deletions gradle/gradle-jacoco-support.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apply plugin: 'jacoco-android'

jacoco {
toolVersion = "0.8.4"
}

tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
2 changes: 1 addition & 1 deletion pre_check_before_push.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/sh

./gradlew clean build test && ./gradlew assembleRelease
./gradlew clean build jacocoTestReport && ./gradlew assembleRelease

0 comments on commit ea83ff5

Please sign in to comment.