plugins {
    id("com.android.application")
}

android {
    signingConfigs {
        create("release") {
            storeFile = file("/home/sergio/BInfoAndroid/burguillos.keystore")
            storePassword = "burguillos"
            keyAlias = "BurguillosInfo"
            keyPassword = "burguillos"
        }
    }
    namespace = "info.burguillos.bi"
    compileSdk = 33

    defaultConfig {
        applicationId = "info.burguillos.bi"
        minSdk = 26
        targetSdk = 33
        versionCode = 4
        versionName = "4.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            isMinifyEnabled = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
            signingConfig = signingConfigs.getByName("release")
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    flavorDimensions += "destination"
    productFlavors {
        create("promo") {
            manifestPlaceholders["host"] = "promo.burguillos.info"
            applicationIdSuffix = ".promo";
            versionNameSuffix = "-promo"
        }
        create("real") {
            manifestPlaceholders["host"] = "burguillos.info"
            versionNameSuffix = "-real"
        }
        create("thinkpad") {
            manifestPlaceholders["host"] = "192.168.1.144"
            applicationIdSuffix = ".think";
            versionNameSuffix = "-think"
        }
        create("lilith") {
            manifestPlaceholders["host"] = "192.168.1.33"
            applicationIdSuffix = ".lilith";
            versionNameSuffix = "-lilith"
        }
    }
}

dependencies {
    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("com.google.android.material:material:1.8.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")

}

allprojects { 
    gradle.projectsEvaluated {
        tasks.withType<JavaCompile> {
            options.compilerArgs.add("-Xlint:deprecation")
        }
    }
}
