cs306-versus/versus-app

View on GitHub
app/build.gradle

Summary

Maintainability
Test Coverage
plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
    id 'jacoco'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-android'
}

android {

    namespace 'com.github.versus'
    compileSdk 33

    defaultConfig {
        applicationId "com.github.versus"
        minSdk 26
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            testCoverageEnabled true
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_9
        targetCompatibility JavaVersion.VERSION_1_9
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }

    buildFeatures {
        viewBinding true
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
    androidTestImplementation  ('androidx.test.espresso:espresso-contrib:3.5.0-alpha06'){
        exclude module: "protobuf-lite"
    }

    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    dokkaPlugin 'org.jetbrains.dokka:android-documentation-plugin:1.8.10'
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    //Import for Google Maps
    implementation 'com.google.android.gms:play-services-maps:18.1.0'
    implementation 'com.google.android.libraries.places:places:3.0.0'
    // Import the Firebase BoM
    implementation platform('com.google.firebase:firebase-bom:31.2.2')
    // TODO: Add the dependencies for any other Firebase products you want to use
    // See https://firebase.google.com/docs/android/setup#available-libraries
    // For example, add the dependencies for Firebase Authentication and Cloud Firestore
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.android.gms:play-services-auth:20.4.1'
    implementation 'com.google.firebase:firebase-firestore'
    implementation 'com.google.firebase:firebase-database:20.1.0'
    //add jackson dependency to convert json strings gotten from database into java objects
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
    implementation 'com.google.maps.android:android-maps-utils:3.4.0'
    testImplementation 'junit:junit:4.13.2'
    testImplementation 'org.mockito:mockito-inline:5.2.0'
    androidTestImplementation 'org.mockito:mockito-android:5.3.1'
    androidTestImplementation 'org.mockito:mockito-core:5.3.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    androidTestImplementation 'androidx.test:runner:1.5.2'
    androidTestImplementation 'androidx.test:rules:1.5.0'
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
    androidTestImplementation 'androidx.fragment:fragment-testing:1.4.0'
    androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.4.0'
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'


    // Caching with Room Database dependencies
    def room_version = "2.5.0"
    implementation "androidx.room:room-runtime:$room_version"
    annotationProcessor "androidx.room:room-compiler:$room_version"
    testImplementation "androidx.room:room-testing:$room_version"
    apply plugin: 'com.google.gms.google-services'
}

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

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
    reports {
        xml.required = true
        html.required = true
    }

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

    sourceDirectories.setFrom(files([mainSrc]))
    classDirectories.setFrom(files([debugTree]))
    executionData.setFrom(fileTree(dir: project.buildDir, includes: [
            'outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec',
            'outputs/code_coverage/debugAndroidTest/connected/*/coverage.ec'
    ]))
}

connectedCheck {
    finalizedBy jacocoTestReport
}