plugins {
    id("com.android.application")
    id("kotlin-android")
    id("kotlin-kapt")
    id("kotlin-parcelize")
    id("packer")
}

android {

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
    signingConfigs {
        register("config") {
            keyAlias = "ccim"
            keyPassword = "123456"
            storeFile = file("ccim_game_accelerator.jks")
            storePassword = "123456"
        }
    }
//    compileSdk 30
    defaultConfig {
        applicationId = "com.ccwangluo.accelerator"
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

        manifestPlaceholders.put("XG_ACCESS_ID", "1580009634")
        manifestPlaceholders.put("XG_ACCESS_KEY", "AIJKAIYR3WPS")
        manifestPlaceholders.put("qqappid", "101994779")
        flavorDimensions.add("1.0")
        ndk {
            abiFilters.add("armeabi-v7a")
            abiFilters.add("arm64-v8a")
        }
    }

    buildTypes {
        named("release") {
            signingConfig?.enableV2Signing = true
            signingConfig = signingConfigs.getByName("config")
            isMinifyEnabled = false
            setProguardFiles(
                listOf(
                    getDefaultProguardFile("proguard-android.txt"),
                    "proguard-rules.pro"
                )
            )
        }
        named("debug") {
            signingConfig = signingConfigs.getByName("config")
            isMinifyEnabled = false
        }
    }
    buildFeatures.viewBinding = true



        packer {
//            archiveNameFormat = "${appPkg}-${buildType}-v${versionName}-${channel}"
            archiveOutput = File(project.rootProject.buildDir, "apks")
            channelFile = project.rootProject.file("channels.txt")
        }

}


setupApp()

dependencies {
    implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
    implementation("androidx.appcompat:appcompat:1.3.1")
    implementation("com.google.android.material:material:1.4.0")
    implementation("androidx.annotation:annotation:1.2.0")
    implementation("androidx.vectordrawable:vectordrawable:1.1.0")
    implementation("androidx.legacy:legacy-support-v4:1.0.0")
    implementation("androidx.recyclerview:recyclerview:1.2.0")
    implementation("androidx.navigation:navigation-fragment-ktx:2.3.0")
    implementation("androidx.navigation:navigation-ui-ktx:2.3.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.3")
    val multidex_version = "2.0.1"
    implementation("androidx.multidex:multidex:$multidex_version")
    val lifecycle_version = "2.3.1"
    implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version")
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")

    implementation("androidx.recyclerview:recyclerview:1.2.1")
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
    implementation("com.github.bumptech.glide:glide:4.12.0")
    implementation("com.squareup.okhttp3:okhttp:4.9.0")
    implementation("com.google.code.gson:gson:2.8.7")
    implementation("com.github.xuexiangjys:XUI:1.1.8")
    //工具类
    implementation("com.github.xuexiangjys.XUtil:xutil-core:2.0.0")
//    implementation("com.github.xuexiangjys.XUtil:xutil-sub:2.0.0")
    implementation("com.tencent:mmkv:1.2.10")
    //美团多渠道打包
    implementation("com.mcxiaoke.packer-ng:helper:2.0.1")

    //XPage
    implementation("com.github.xuexiangjys.XPage:xpage-lib:3.3.0")
    kapt("com.github.xuexiangjys.XPage:xpage-compiler:3.3.0")

    implementation("com.github.getActivity:ToastUtils:10.3")

    implementation("com.chuanglan.android.sdk:shanyan:2.3.4.3")

    implementation("com.github.xuexiangjys.AgentWeb:agentweb-core:1.0.0")
    implementation("com.github.xuexiangjys.AgentWeb:agentweb-download:1.0.0")
    implementation("com.github.xuexiangjys.AgentWeb:agentweb-filechooser:1.0.0")

    // 友盟基础组件库（所有友盟业务SDK都依赖基础组件库）
    implementation("com.umeng.umsdk:common:9.4.7")// (必选))
    implementation("com.umeng.umsdk:asms:1.5.0")// 必选)

    implementation("com.umeng.umsdk:share-core:7.1.7")//分享核心库，必选)
    implementation("com.umeng.umsdk:share-board:7.1.7")//分享面板功能，可选)

    //在线依赖目前支持QQ、微信、新浪微博、支付宝、钉钉；若需支持其他平台，请选择手动下载SDK

    implementation("com.umeng.umsdk:share-wx:7.1.7") //微信完整版)
    implementation("com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.9")
//
    implementation("com.umeng.umsdk:share-qq:7.1.7")//QQ完整版)
//    implementation("com.squareup.okhttp3:okhttp:3.14.9")//QQ官方sdk 3.53及之后版本需要集成okhttp3.x，必选)

    //gps
    implementation("com.tencent.map.geolocation:TencentLocationSdk-openplatform:7.3.0")

    implementation("com.github.bumptech.glide:glide:4.11.0")
    annotationProcessor("com.github.bumptech.glide:compiler:4.11.0")

    implementation("com.github.open-android:JieCaoVideoPlayer:0.1.0")

    implementation("com.tencent.bugly:crashreport_upgrade:latest.release")//其中latest.release指代最新版本号，也可以指定明确的版本号，例如1.2.0
    implementation("com.tencent.bugly:nativecrashreport:latest.release")
    implementation("com.tencent.tpns:tpns:1.3.2.0-release")
    //支付宝支付
    implementation("com.alipay.sdk:alipaysdk-android:+@aar")
}