apply plugin: 'com.android.application'

android {
    compileSdk 35
    compileOptions.encoding = 'UTF-8'

    defaultConfig {
        applicationId "net.sourceforge.opencamera"
        minSdkVersion 21
        targetSdkVersion 35
        //compileSdkVersion 31 // needed to support appcompat:1.4.0 (which we need for emoji policy support, and not yet ready to target SDK 30)

        testApplicationId "net.sourceforge.opencamera.test"
        //testInstrumentationRunner "android.test.InstrumentationTestRunner"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }


    // needed to use android.test package (ActivityInstrumentationTestCase2 etc) when targetting sdk 28 (Android 9) -
    // see https://developer.android.com/training/testing/set-up-project
    useLibrary 'android.test.runner'
    useLibrary 'android.test.base'
    lint {
        abortOnError false
        checkReleaseBuilds false
    }
    namespace 'net.sourceforge.opencamera'
    buildFeatures {
    }
    //useLibrary 'android.test.mock'
}

dependencies {
    androidTestImplementation 'androidx.test.ext:junit:1.3.0'

    //implementation 'androidx.activity:activity:1.9.3' // needed for EdgeToEdge.enable(this)

    // appcompat version must be 1.4.0 or later to satisfy emoji policy!
    implementation 'androidx.appcompat:appcompat:1.7.1'

    // needed to fix errors since upgrading to appcompat:1.7.0, see https://stackoverflow.com/questions/75263047/duplicate-class-in-kotlin-android
    implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.0"))

    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    implementation 'androidx.exifinterface:exifinterface:1.4.1'

    testImplementation 'junit:junit:4.13.2'

    // newer AndroidJUnit4 InstrumentedTest
    androidTestImplementation "androidx.test:runner:1.7.0"
    androidTestImplementation "androidx.test:rules:1.7.0"
    androidTestImplementation "androidx.test.espresso:espresso-core:3.7.0"
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}
