plugins {
    alias(libs.plugins.android.application)
}

android {
    namespace = 'de.schliweb.makeacopy.lang.latin.best'
    compileSdk = 36

    defaultConfig {
        applicationId "de.schliweb.makeacopy.lang.latin.best"
        minSdk = 29
        targetSdk = 36
        versionCode 10100
        versionName "1.1.0"
    }

    signingConfigs {
        release {
            def myStorePassword = project.findProperty("SIGNING_STORE_PASSWORD") ?: System.getenv("SIGNING_STORE_PASSWORD")
            def myKeyAlias = project.findProperty("SIGNING_KEY_ALIAS") ?: System.getenv("SIGNING_KEY_ALIAS")
            def myKeyPassword = project.findProperty("SIGNING_KEY_PASSWORD") ?: System.getenv("SIGNING_KEY_PASSWORD")
            if (myStorePassword && myKeyAlias && myKeyPassword) {
                storeFile file('keystore.jks')
                storePassword myStorePassword
                keyAlias myKeyAlias
                keyPassword myKeyPassword
            }
        }
    }

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

    dependenciesInfo {
        // Disables the inclusion of dependency metadata in the APK,
        // required for F-Droid to comply with its focus on privacy and transparency.
        // Dependency metadata is unnecessary and could expose additional information.
        includeInApk = false
        // Disables the inclusion of dependency metadata in Android App Bundles as well.
        includeInBundle = false
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }

    aaptOptions { noCompress 'traineddata' }

    buildFeatures {
        buildConfig = false
        viewBinding = false
    }
}

dependencies {
    // none
}

if (System.getenv("CI") == "true" || System.getenv("FDROID_BUILD") == "1") {
    tasks.configureEach { if (it.name.startsWith("lint")) it.enabled = false }
}
