plugins {
    id "com.android.application"
    id "kotlin-android"
    // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
    id "dev.flutter.flutter-gradle-plugin"
    //推送配置
    // id 'com.google.gms.google-services'
    id 'com.huawei.agconnect'
    id 'com.hihonor.mcs.asplugin'
}

android {
    namespace = "cn.net.wzj.mall"
    // compileSdk = flutter.compileSdkVersion
    compileSdk = 35
    ndkVersion = flutter.ndkVersion

    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
    }

    // 推送配置文件
    sourceSets {
        main {
            assets.srcDirs += ['src/main/assets']
        }
    }


    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId = "cn.net.wzj.mall"
        // You can update the following values to match your application needs.
        // For more information, see: https://flutter.dev/to/review-gradle-config.
        // minSdk = flutter.minSdkVersion
        minSdk = 23
        // targetSdk = flutter.targetSdkVersion
        targetSdk = 35
        versionCode = flutter.versionCode
        versionName = flutter.versionName    
        // 魅族包开启ndk打包
        // ndk {
        //     abiFilters "arm64-v8a" // 只保留 64 位
        // }  
    }

    // 配置签名
    signingConfigs {
        release {
            storeFile file("./android.keystore") //证书
            storePassword "wuzhongjie" //证书密码
            keyAlias "wuzhong" //别名
            keyPassword "wuzhongjie" //别名密码
        }
    }

    buildTypes {
        debug {
            signingConfig signingConfigs.release //让 debug 用 release 签名
        }
        // Signing with the debug keys for now, so `flutter run --release` works.
        release {
            signingConfig signingConfigs.release 
            minifyEnabled false
            shrinkResources false
        }
    }
}

flutter {
    source = "../.."
}

//推送配置
dependencies {
     // 版本号 “VERSION” 请前往 更新日志 中获取配置。
     // Huawei
     implementation 'com.tencent.timpush:huawei:8.6.7019'
     implementation 'org.bouncycastle:bcprov-jdk15on:1.70' // 华为推送 SDK 加密库

     // XiaoMi
     implementation 'com.tencent.timpush:xiaomi:8.6.7019'
     // OPPO
     implementation 'com.tencent.timpush:oppo:8.6.7019'
     // vivo
     implementation 'com.tencent.timpush:vivo:8.6.7019'
     // Honor
     implementation 'com.tencent.timpush:honor:8.6.7019'
     // Meizu
     implementation 'com.tencent.timpush:meizu:8.6.7019'
     // Google Firebase Cloud Messaging (Google FCM)
    //  implementation 'com.tencent.timpush:fcm:8.6.7019'

    // 裁剪依赖
    implementation 'com.github.yalantis:ucrop:2.2.10'
}

