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

android {
    compileSdk 33

    // When building this project with with SDK build tools of version earlier than 31.0.0, and
    // minSdkVersion 29+, the RenderScript compiler will fail with the following error message:
    //
    //     error: target API level '29' is out of range ('11' - '24')
    //
    // This issue has been fixed in SDK build tools 31.0.0.
    buildToolsVersion '31.0.0'

    defaultConfig {
        applicationId "com.android.example.rsmigration"
        minSdkVersion 29
        targetSdkVersion 31
        ndkVersion '22.0.7026061'
        renderscriptTargetApi 24
        versionCode 1
        versionName "1.0"

        externalNativeBuild {
            cmake {
                arguments '-DANDROID_TOOLCHAIN=clang',
                          '-DANDROID_STL=c++_static'
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled false
        }
    }
    externalNativeBuild {
        cmake {
            version '3.10.2'
            path 'src/main/cpp/CMakeLists.txt'
        }
    }

    sourceSets {
        main {
            jniLibs {
                srcDirs 'src/main/jniLibs/android-binaries-sdk-1.3.261.0'
            }
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9")
    implementation("androidx.graphics:graphics-core:1.0.0-alpha04")
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
