apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

//apply plugin: com.bihe0832.android.plugin.TransformTestPlugin
// 不同类型的包，仅仅修改下面两项即可，其余内容保持一致
project.ext.applicationID = "com.bihe0832.android.test"
project.ext.applicationName = "子勰Lib"
project.ext.applicationPrefix = "Zixie"

android {
    compileSdkVersion project.compileSdkVersion
    buildToolsVersion project.buildToolsVersion

    defaultConfig {
        applicationId applicationID
        minSdkVersion project.appMinSdkVersion
        targetSdkVersion project.targetSdkVersion
        versionName project.versionName
        versionCode project.versionCode
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

    }

    packagingOptions {
        project.ndk_abiFilters_project.split(",").each { abiItem ->
            def finalDoNotStripFileName = "*/" + abiItem + "/*.so"
            doNotStrip finalDoNotStripFileName
        }

        project.ndk_abiFilters_all.split(",").each { abiItem ->
            project.pickFirstList.each { item ->
                def finalPickFirstFileName = "lib/" + abiItem + "/" + item
                pickFirst finalPickFirstFileName
            }
        }

        project.excludeList.each { item ->
            exclude item
        }
    }

    lintOptions {
        abortOnError false
    }

    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion project.compose_version
    }

    signingConfigs {
        debug {
            keyAlias project.signingConfigs.keyAlias
            keyPassword project.signingConfigs.keyPassword
            storeFile file(project.signingConfigs.storeFile)
            storePassword project.signingConfigs.storePassword
            v1SigningEnabled project.signingConfigs.v1SigningEnabled as boolean
            v2SigningEnabled project.signingConfigs.v2SigningEnabled as boolean
        }

        release {
            keyAlias project.signingConfigs.keyAlias
            keyPassword project.signingConfigs.keyPassword
            storeFile file(project.signingConfigs.storeFile)
            storePassword project.signingConfigs.storePassword
            v1SigningEnabled project.signingConfigs.v1SigningEnabled as boolean
            v2SigningEnabled project.signingConfigs.v2SigningEnabled as boolean
        }
    }

    archivesBaseName = applicationPrefix + "_V${defaultConfig.versionName}_${defaultConfig.versionCode}"

    buildTypes {
        debug {
            signingConfig signingConfigs.debug
            minifyEnabled false
            shrinkResources false
        }

        release {
            signingConfig signingConfigs.release
            minifyEnabled project.minifyEnabled as boolean
            proguardFiles "./../proguard-rules-common.pro"
            shrinkResources false
        }
    }

    configurations.all {
        resolutionStrategy {
            force("androidx.lifecycle:lifecycle-livedata-core:2.6.0")
        }
    }
}

