basbeu/theSofties

View on GitHub
app/build.gradle

Summary

Maintainability
Test Coverage
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
apply plugin: 'com.google.gms.google-services'



jacoco {
    toolVersion = "0.8.0"
}

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "ch.epfl.sweng.favors"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 4
        dataBinding {
            enabled = true
        }
        versionName "1.0.a1-favors"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        debug {
            testCoverageEnabled true
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    /*lintOptions {
        abortOnError false
    }*/
    compileOptions {
        targetCompatibility '1.8'
        sourceCompatibility '1.8'
    }
}

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.android.support:support-vector-drawable:28.0.0'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    // firebase services
    implementation 'com.google.firebase:firebase-auth:16.0.4'
    implementation 'com.google.firebase:firebase-storage:16.0.4'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-functions:16.1.3'
    implementation 'com.google.firebase:firebase-firestore:17.1.1'

    // location play service
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    // dexter runtime permissions
    // runtime permissions letting user to allow or deny any permission at runtime.
    // Implementing runtime permissions is a tedious process and developer needs to write lot of code just to get a single permission.
    implementation 'com.karumi:dexter:4.2.0'
    // ButterKnife view binding
    // Android ButterKnife library is a view injection library that injects views into android activity / fragments using annotations.
    // For example, @BindView annotation avoids using findViewById() method by automatically type casting the view element.
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    // UnitTest & testing
    implementation "android.arch.lifecycle:extensions:1.1.1"
    implementation "android.arch.lifecycle:viewmodel:1.1.1"

    implementation "com.squareup.retrofit2:retrofit:2.4.0"
    implementation "com.squareup.retrofit2:converter-gson:2.4.0"

    annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:2.8.9'
    testImplementation 'org.powermock:powermock-core:2.0.0-RC.4'
    androidTestImplementation 'org.mockito:mockito-android:2.8.9'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    androidTestImplementation "com.android.support.test.espresso:espresso-intents:3.0.2"
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
    androidTestImplementation "com.android.support.test.espresso:espresso-contrib:3.0.2"
    implementation 'com.google.android.gms:play-services-maps:16.0.0'

    implementation 'com.github.igalata:Bubble-Picker:v0.2.4'
}

tasks.withType(Test) {
    jacoco.includeNoLocationClasses = true
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {

    reports {
        xml.enabled = true
        html.enabled = true
    }

    def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*',
                      '**/android/databinding/*',
                      '**/*Binding*.*',
                      '**/*BR*.*',
                      '**/*Rx*.*',
                      '**/*$Lambda$*.*',
                      '**/*Module.*',
                      '**/*Dagger*.*',
                      '**/*MembersInjector*.*',
                      '**/*_Provide*Factory*.*']

    def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
    def mainSrc = "$project.projectDir/src/main/java"

    sourceDirectories = files([mainSrc])
    classDirectories = files([debugTree])
    executionData = fileTree(dir: project.buildDir, includes: [
            'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
    ])
}