apply plugin: "com.android.application"

android {
    compileSdk 34
    defaultConfig {
        applicationId "com.example.android.testing.espresso.CustomMatcherSample"
        minSdkVersion 21
        targetSdkVersion 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    productFlavors {
    }
    // Configure the `test` and `android` variants to share the same test source
    sourceSets {
        test {
            java.srcDir "src/sharedTest/java"
        }
        androidTest {
            java.srcDir "src/sharedTest/java"
        }
    }
    testOptions {
        unitTests {
            includeAndroidResources = true
        }
        managedDevices {
            devices {
                // run with ../gradlew  nexusOneApi30DebugAndroidTest
                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {
                    // A lower resolution device is used here for better emulator performance
                    device = "Nexus One"
                    apiLevel = 30
                    // Also use the AOSP ATD image for better emulator performance
                    systemImageSource = "aosp-atd"
                }
            }
        }
    }
    namespace "com.example.android.testing.espresso.CustomMatcherSample"
    testNamespace "com.example.android.testing.espresso.CustomMatcherSample.test"
    lint {
        abortOnError false
    }
}

dependencies {
    // App dependencies
    implementation "androidx.annotation:annotation:" + rootProject.androidxAnnotationVersion
    implementation "com.google.guava:guava:" + rootProject.guavaVersion

    // Testing-only dependencies
    androidTestImplementation "androidx.test:core:" + rootProject.coreVersion;
    androidTestImplementation "androidx.test.ext:junit:" + rootProject.extJUnitVersion;
    androidTestImplementation "androidx.test:runner:" + rootProject.runnerVersion;
    androidTestImplementation "androidx.test.espresso:espresso-core:" + rootProject.espressoVersion;
    androidTestImplementation "org.robolectric:annotations:" + rootProject.robolectricVersion;

    testImplementation "androidx.test:core:" + rootProject.coreVersion;
    testImplementation "androidx.test.ext:junit:" + rootProject.extJUnitVersion;
    testImplementation "androidx.test.espresso:espresso-core:" + rootProject.espressoVersion;
    testImplementation "org.robolectric:robolectric:" + rootProject.robolectricVersion;
}
