plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
    id 'org.jetbrains.kotlin.kapt'
}

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

android {
    namespace 'com.fluttercandies.photo_manager_example'

    compileSdk flutter.compileSdkVersion
    ndkVersion = "27.0.12077973"

    kotlinOptions {
        jvmTarget = '17'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

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

    defaultConfig {
        applicationId "com.fluttercandies.photo_manager_example"
        minSdkVersion 21
        targetSdk = flutter.targetSdkVersion
        versionCode = flutter.versionCode
        versionName = flutter.versionName
    }

    signingConfigs {
        forAll {
            storeFile file("${rootDir.absolutePath}/photo-manager-keystore")
            storePassword '123456'
            keyAlias 'key0'
            keyPassword '123456'
        }
    }

    buildTypes {
        debug {
            signingConfig signingConfigs.forAll
        }
        profile {
            signingConfig signingConfigs.forAll
        }
        release {
            signingConfig signingConfigs.forAll
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation 'com.github.bumptech.glide:glide:4.15.1'
    kapt 'com.github.bumptech.glide:compiler:4.15.1'
}
