plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.akatsukirika.openps'
    compileSdk 34

    defaultConfig {
        applicationId "com.akatsukirika.openps"
        minSdk 23
        targetSdk 34
        versionCode 7
        versionName "1.5.0"

        buildFeatures {
            compose true
        }

        composeOptions {
            kotlinCompilerExtensionVersion = composeCompilerVersion
        }

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags '-std=c++17'
            }
        }
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    externalNativeBuild {
        cmake {
            path file('src/main/cpp/CMakeLists.txt')
            version '3.22.1'
        }
    }
    buildFeatures {
        viewBinding true
    }

    applicationVariants.configureEach { variant ->
        variant.outputs.configureEach {
            outputFileName = "OpenPS-v${defaultConfig.versionName}.apk"
        }
    }
}

dependencies {
    implementation 'androidx.core:core-ktx:1.13.1'
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'androidx.activity:activity-ktx:1.9.2'
    implementation 'com.google.android.material:material:1.12.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.github.bumptech.glide:glide:4.16.0'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.5'
    implementation "io.coil-kt.coil3:coil-compose:$coilVersion"
    implementation project(':gpupixel')

    // Compose
    implementation "androidx.compose.ui:ui:$composeVersion"
    implementation "androidx.compose.material:material:$composeVersion"
    debugImplementation "androidx.compose.ui:ui-tooling:$composeVersion"
    implementation "androidx.compose.ui:ui-tooling-preview:$composeVersion"
    implementation "androidx.activity:activity-compose:$activityComposeVersion"
    implementation project(':kotstore')
}