plugins {
    alias(libs.plugins.androidApplication)
}

def keystoreFile = rootProject.file("app/sp.jks")

android {
    if (keystoreFile.exists()) {
        signingConfigs {
            release {
                storeFile file("sp.jks")
                storePassword "smartpack"
                keyAlias "sp_key1"
                keyPassword "smartpack"
            }
        }
    }

    dependenciesInfo {
        // Disables dependency metadata when building APKs.
        includeInApk = false
        // Disables dependency metadata when building Android App Bundles.
        includeInBundle = false
    }

    compileSdk 36
    namespace 'com.sunilpaulmathew.debloater'

    defaultConfig {
        applicationId "com.sunilpaulmathew.debloater"
        minSdkVersion 23
        targetSdk 35
        versionCode 30
        versionName "v0.30"
        vectorDrawables.useSupportLibrary = true
        testFunctionalTest = false
        testHandleProfiling = false

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            if (keystoreFile.exists()) {
                signingConfig signingConfigs.release
            }
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    buildFeatures {
        buildConfig = true
    }
    lint {
        abortOnError false
    }
}

dependencies {
    implementation libs.rootfilepicker
    implementation libs.adapters
    implementation libs.apkutils
    implementation libs.credits
    implementation libs.fileutils
    implementation libs.jsonutils
    implementation libs.packageutils
    implementation libs.permissionutils
    implementation libs.themeutils
    implementation libs.translatorutils
    implementation libs.libsu
    implementation libs.material
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}