apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 32
    defaultConfig {
        applicationId "com.google.android.samples.dynamiccodeloading"
        minSdkVersion 21
        targetSdkVersion 32
        versionCode 33
        versionName "1.0.33"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        debugR8 {
            initWith(debug)
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }

        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.debug
        }
    }

    flavorDimensions "codeLoading"

    productFlavors {
        reflect {
            dimension "codeLoading"
        }

        serviceLoader {
            dimension "codeLoading"
        }

        dagger {
            dimension "codeLoading"
        }
    }

    dynamicFeatures = [":storage"]
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

    api 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation "com.google.android.play:core:1.4.1"

    daggerApi 'com.google.dagger:dagger:2.16'
    api 'com.google.dagger:dagger-android-support:2.16'

    kapt 'com.google.dagger:dagger-compiler:2.16'

    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-alpha04'
    androidTestImplementation 'androidx.test:rules:1.2.0-alpha04'
}
