plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
    id "com.google.gms.google-services"
    id "com.google.firebase.crashlytics"
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    namespace = "hu.app_dev.terepi_seged"
    compileSdk 36
    // ndkVersion "25.1.8937393"
    // ndkVersion flutter.ndkVersion
    //ndkVersion "27.0.12077973"
    ndkVersion "28.2.13676358"

    compileOptions {
        // sourceCompatibility JavaVersion.VERSION_1_8
        // targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

    kotlinOptions {
        // jvmTarget = JavaVersion.VERSION_1_8 
        jvmTarget = JavaVersion.VERSION_17 
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "hu.app_dev.terepi_seged"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
        minSdkVersion 26
        targetSdkVersion 35
        versionCode flutter.versionCode
        versionName flutter.versionName

        // archivesBaseName = "terepi_seged-${versionName}-${new Date().format('yyyyMMdd-HHmm')}"
        // multiDexEnabled true
    }

    signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }  

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.release
        }
    }
}

flutter {
    source '../..'
}

// dependencies {
//     implementation platform('com.google.firebase:firebase-bom:31.3.0')
//     implementation 'com.google.firebase:firebase-analytics-ktx'
// }
