apply plugin: 'com.android.application'

android {
    signingConfigs {
        localConfig {
            keyAlias 'androiddebugkey'
            storeFile file(System.getProperty("user.home") + '/.android/debug.keystore')
            storePassword 'android'
            keyPassword 'android'
        }
    }
    if (project.android.hasProperty("namespace")) {
        namespace 'com.arthenica.ffmpegkit.test'
    }
    compileSdk 33
    defaultConfig {
        applicationId "com.arthenica.ffmpegkit.test"
        minSdk 24
        targetSdk 33
        versionCode 240600
        versionName "6.0"
    }
    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.localConfig
        }
    }
    splits {
        abi {
            enable true
            reset()
            include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
            universalApk false
        }
    }
}

ext.abiCodes = ['x86': 1, 'x86_64': 2, 'armeabi-v7a': 3, 'arm64-v8a': 4]

import com.android.build.OutputFile

android.applicationVariants.all { variant ->
    variant.outputs.each {
        output ->
            def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
            output.versionCodeOverride = baseAbiVersionCode + variant.versionCode
    }
}

dependencies {
    // implementation files('../../../ffmpeg-kit/prebuilt/bundle-android-aar-lts/ffmpeg-kit/ffmpeg-kit.aar')
    implementation files('../../../ffmpeg-kit/prebuilt/bundle-android-aar/ffmpeg-kit/ffmpeg-kit.aar')
    implementation 'com.arthenica:smart-exception-java:0.2.1'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
