LEuLuDyHa/app

View on GitHub
domain/build.gradle

Summary

Maintainability
Test Coverage
plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
    id "com.google.gms.google-services"
    id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21'
}

android {
    compileSdk 33

    namespace 'com.github.leuludyha.domain'

    defaultConfig {
        minSdk 24
        targetSdk 33

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            testCoverageEnabled true
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation "androidx.core:core-ktx:1.10.0"
    implementation "androidx.appcompat:appcompat:$appcompat_version"

    testImplementation "junit:junit:$junit_version"
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    // Coroutines test
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4"

    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    //Coroutines
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
    androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4"

    //GSON
    implementation 'com.google.code.gson:gson:2.10.1'

    // JSON
    implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0'

    // Google truth for assertions
    testImplementation "com.google.truth:truth:1.1.3"
    androidTestImplementation "com.google.truth:truth:1.1.3"
    testImplementation 'org.hamcrest:hamcrest:2.2'

    //ROOM DB
    implementation "androidx.room:room-ktx:2.5.1"

    // Paging 3.0
    implementation "androidx.paging:paging-compose:$paging_version"

    //Camerax
    def camerax_version = "1.3.0-alpha04"
    implementation "androidx.camera:camera-core:1.3.0-alpha06"

    //Barcode Analyser
    implementation 'com.google.mlkit:barcode-scanning:17.1.0'
    //implementation "androidx.paging:paging-compose:$paging_version"

    //Firebase
    implementation platform("com.google.firebase:firebase-bom:$firebase_bom_version")
    implementation "com.google.firebase:firebase-auth-ktx"
    implementation "com.google.firebase:firebase-firestore-ktx"

    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-database-ktx'
    implementation 'com.google.firebase:firebase-auth:21.3.0'

    //Play Services
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$play_services_version"
    implementation "com.google.android.gms:play-services-auth:20.5.0"

}

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

    def fileFilter = [
            // TODO if we use Hilt later on, special case to handle (see bootcamp week 1)
            '**/R.class',
            '**/R$*.class',
            '**/BuildConfig.*',
            '**/Manifest*.*',
            '**/*Test*.*',
            'android/**/*.*',
            // kotlin
            '**/*MapperImpl*.*',
            '**/*$ViewInjector*.*',
            '**/*$ViewBinder*.*',
            '**/BuildConfig.*',
            '**/*Component*.*',
            '**/*BR*.*',
            '**/Manifest*.*',
            '**/*$Lambda$*.*',
            '**/*Companion*.*',
            '**/*Module*.*',
            '**/*Dagger*.*',
            '**/*Hilt*.*',
            '**/*MembersInjector*.*',
            '**/*_MembersInjector.class',
            '**/*_Factory*.*',
            '**/*_Provide*Factory*.*',
            '**/*Extensions*.*',
            // sealed and data classes
            '**/*$Result.*',
            '**/*$Result$*.*',
            // adapters generated by moshi
            '**/*JsonAdapter.*',
            '**/Color.kt',
            '**/Theme.kt',
            '**/Type.kt',
    ]
    def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", 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
}