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

android {
    namespace 'com.fabernovel.testndkapp'
    compileSdkVersion System.getenv("COMPILE_SDK_VERSION") as Integer
    buildToolsVersion System.getenv("BUILD_TOOLS_VERSION")

    defaultConfig {
        applicationId "com.fabernovel.testndkapp"
        minSdkVersion System.getenv("MIN_SDK_VERSION") as Integer
        targetSdkVersion System.getenv("TARGET_SDK_VERSION") as Integer
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }
    }

    buildFeatures {
        viewBinding true
    }

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_21
        targetCompatibility JavaVersion.VERSION_21
    }
    kotlinOptions {
        jvmTarget = "21"
    }

    ndkVersion System.getenv("NDK_VERSION")

    externalNativeBuild {
        cmake {
            path "src/main/cpp/CMakeLists.txt"
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
