apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 36
    defaultConfig {
        applicationId "com.dozingcatsoftware.vectorcamera"
        minSdkVersion 23
        targetSdkVersion 36
        versionCode 15
        versionName "2.0.0"
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        
        ndk {
            abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
        }
        
        externalNativeBuild {
            cmake {
                cppFlags '-std=c++17'
                arguments '-DANDROID_STL=c++_shared', '-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON'
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    namespace 'com.dozingcatsoftware.vectorcamera'
    externalNativeBuild {
        cmake {
            path file('src/main/cpp/CMakeLists.txt')
            version '3.22.1'
        }
    }
    compileOptions {
        sourceCompatibility 21
        targetCompatibility 21
    }
    // https://developer.android.com/topic/libraries/view-binding/migration#groovy
    buildFeatures {
        viewBinding true
    }
    kotlinOptions {
        jvmTarget = '21'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.7.1'
    implementation "androidx.preference:preference-ktx:1.2.1"
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2"
    // Avoids duplicate class errors: https://stackoverflow.com/questions/69817925/problem-duplicate-class-androidx-lifecycle-viewmodel-found-in-modules
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.3'
    implementation 'com.jaredrummler:colorpicker:1.1.0'
    // The xiph.org Vorbis encoding library is included as source, in src/main/java/org/xiph.
    // It was downloaded from https://xiph.org/downloads/
}
