plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
}
def version = '1.0.2'

def releaseTime() {
    return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
}

android {
    compileSdk = rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion 33

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

    buildTypes {

        debug {
//            libraryVariants.all { variant->
//                variant.outputs.all { output ->
//                    if (outputFile != null && outputFileName.endsWith('.aar')) {
//                        outputFileName = "ad_core_${version}_${releaseTime()}_debug.aar"
//                    }
//                }
//            }
        }

        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

            libraryVariants.all { variant ->
                variant.outputs.all { output ->
                    if (outputFile != null && outputFileName.endsWith('.aar')) {
                        outputFileName = "ad_core_${version}_${releaseTime()}_release.aar"
                    }
                }
            }
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
//    api fileTree(dir: "libs", include: ["*.jar", "*.aar"])
    /*Base*/
    api 'androidx.appcompat:appcompat:1.6.1'
    api 'com.google.android.material:material:1.8.0'
    /*Kotlin*/
    api "androidx.core:core-ktx:1.10.0"
    api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
    api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
    api 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
    /*GroMore*/
    api 'com.pangle.cn:mediation-sdk:5.1.6.1'
//    api 'com.pangle.cn:mediation-test-tools:5.1.6.1'//测试工具
}