Ph0tonic/SDP_Projet

View on GitHub
app/build.gradle

Summary

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

jacoco {
    toolVersion = "0.8.6"
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"
    defaultConfig {
        applicationId "ch.epfl.sdp"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
    }
    packagingOptions {
        pickFirst 'lib/x86/libc++_shared.so'
        pickFirst 'lib/x86_64/libc++_shared.so'
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
    }
    buildTypes {
        debug {
            testCoverageEnabled true
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    buildFeatures {
        viewBinding true
    }

    // To inline the bytecode built with JVM target 1.8 into
    // bytecode that is being built with JVM target 1.6. (e.g. navArgs)
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }

    splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a', 'arm64-v8a'
            universalApk true
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.preference:preference-ktx:1.1.1'
    implementation "androidx.core:core-ktx:1.3.2"
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0-alpha2'
    implementation "androidx.room:room-ktx:2.2.6"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation 'org.videolan.android:libvlc-all:3.1.12'
    implementation 'com.google.firebase:firebase-analytics:18.0.2'
    implementation 'com.google.firebase:firebase-database:19.6.0'
    implementation 'com.google.firebase:firebase-database-ktx:19.6.0'
    implementation 'com.google.android.gms:play-services-auth:19.0.0'
    implementation 'io.mavsdk:mavsdk:0.3.1'
    implementation 'io.mavsdk:mavsdk-server:0.3.1'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-offline-v9:0.7.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0'
    implementation 'com.google.guava:guava:28.2-android'
    implementation 'com.jakewharton.timber:timber:4.7.1'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.mikhaellopez:circularimageview:4.2.0'
    implementation 'com.github.mastrgamr:mapbox-android-utils:v0.3'
    implementation 'com.getbase:floatingactionbutton:1.10.1'
    annotationProcessor "androidx.room:room-compiler:2.2.6"
    testImplementation 'junit:junit:4.13'
    debugImplementation 'androidx.fragment:fragment-testing:1.3.0'
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.3'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
    androidTestImplementation 'androidx.test:rules:1.3.0'
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    androidTestImplementation "androidx.arch.core:core-testing:2.1.0"
    androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
    androidTestImplementation 'com.android.support.test:runner:1.1.1'
    androidTestImplementation 'org.mockito:mockito-android:3.3.3'
}


tasks.withType(Test) {
    jacoco.includeNoLocationClasses = true
    jacoco.excludes = ['jdk.internal.*']
}

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

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

    def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
    def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
    def mainSrc = "$project.projectDir/src/main/java"

    getSourceDirectories().from(files([mainSrc]))
    getClassDirectories().from(files([debugTree]))
    getExecutionData().from(fileTree(dir: project.buildDir, includes: [
            'outputs/code_coverage/debugAndroidTest/connected/*coverage.ec',
            'jacoco/testDebugUnitTest.exec'
    ]))
}