LEuLuDyHa/app

View on GitHub
data/build.gradle

Summary

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

android {
    compileSdk 33

    namespace 'com.github.leuludyha.data'

    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 project(path: ':domain')

    implementation "androidx.core:core-ktx:1.10.0"
    implementation "androidx.appcompat:appcompat:$appcompat_version"
    implementation 'androidx.paging:paging-runtime-ktx:3.1.1'
    testImplementation "junit:junit:$junit_version"
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    // Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
    implementation 'com.google.code.gson:gson:2.9.0'

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

    // Coroutines test
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4"
    androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4"

    // Mock web server
    testImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0'
    androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0'

    // Google truth for assertions
    testImplementation "com.google.truth:truth:1.1.3"
    androidTestImplementation "com.google.truth:truth:1.1.3"

    //ROOM DB
    implementation "androidx.room:room-runtime:2.5.1"
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
    kapt "androidx.room:room-compiler:$room_version"
    implementation "androidx.room:room-ktx:2.5.1"
    implementation "androidx.room:room-paging:2.5.1"

    // Paging 3.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"

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

    // Nearby connections
    implementation 'com.google.android.gms:play-services-nearby:18.5.0'

    // Submodules
    implementation project(path: ':domain')

    //Firebase
    implementation platform('com.google.firebase:firebase-bom:31.3.0')
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-database-ktx'
    implementation 'com.google.firebase:firebase-auth:21.3.0'

    implementation "com.google.firebase:firebase-auth-ktx"
    implementation "com.google.firebase:firebase-firestore-ktx"

    //Picasso
    implementation 'com.squareup.picasso:picasso:2.8'

}

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

    def fileFilter = [
            // data binding
            'android/databinding/**/*.class',
            '**/android/databinding/*Binding.class',
            '**/android/databinding/*',
            '**/androidx/databinding/*',
            '**/BR.*',
            // android
            '**/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
}