/* old code
def localProperties = new Properties()

def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

*/

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

android {

    ndkVersion = "27.0.12077973"
    signingConfigs {
        release {
            storeFile file('/Users/afzal/AndroidStudioProjects/bagisto_2_flutter_mobile_app/Bagisto.jks')
            storePassword 'admin123'
            keyAlias 'bagisto'
            keyPassword 'admin123'
        }
    }

    namespace 'webkul.bagisto_app_demo'
    namespace "com.example.bagisto_app_demo"
    compileSdkVersion 35
//    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
        coreLibraryDesugaringEnabled true
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    buildFeatures {
        dataBinding = true
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        applicationId "com.webkul.bagisto.mobikul"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion 22
        targetSdkVersion 35
        versionCode 232
        versionName "2.3.2"
    }
    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            signingConfig signingConfigs.debug
        }
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation platform('com.google.firebase:firebase-bom:29.1.0')
    implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.17.1'
    //    ML KIT
    api 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.0'
    api 'com.google.mlkit:image-labeling:17.0.7'
    // Image labeling custom
    api 'com.google.mlkit:image-labeling-custom:17.0.1'
    //===Ar Core
    implementation "com.google.ar.sceneform.ux:sceneform-ux:1.17.1"
    implementation 'com.google.ar.sceneform:assets:1.17.1'
    implementation "com.google.ar:core:1.30.0"
    //---------------------------------------//
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    implementation 'com.google.android.material:material:1.5.0'

    // core level dependency
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
    implementation 'commons-io:commons-io:2.11.0'

    // paypal
    implementation("com.squareup.okhttp3:okhttp:4.12.0")
    implementation("com.google.code.gson:gson:2.10.1")

    implementation("com.paypal.android:paypal-web-payments:1.5.0")

}
