plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.google.devtools.ksp'
    id 'kotlinx-serialization'
    id 'easy.register'
    id 'android.aop'
//    id 'kotlin-android'
//    id 'kotlin-parcelize'
//    id 'kotlin-kapt'
//    id "io.github.FlyJingFish.AndroidAop.android-aop" version "1.2.8"
}

apply from: "$rootDir/gradle/android_base.gradle"
androidAopConfig {
    enabled true
    // debug 为true打开日志方便调试
    debug true
    // 测试
    //默认关闭，开启后将会生成切点信息json文件在 /build/tmp/cutInfo.json
    cutInfoJson true
    increment false
    // 移除kotlin相关，编译错误和提升速度
    exclude 'kotlin.jvm', 'kotlin.internal','kotlinx.coroutines.internal', 'kotlinx.coroutines.android'
    excludePackaging 'META-INF/DEPENDENCIES', 'META-INF/NOTICE' , 'META-INF/LICENSE' , 'META-INF/LICENSE.txt' , 'META-INF/NOTICE.txt' , 'license/README.dom.txt' , 'license/LICENSE.dom-documentation.txt' , 'license/NOTICE' , 'license/LICENSE.dom-software.txt' , 'license/LICENSE'
}
android {
    namespace 'com.flyjingfish.androidaop'
    compileSdk 33
    defaultConfig {
        applicationId "com.flyjingfish.androidaop"
        targetSdk 33
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildFeatures {
        viewBinding true
    }

    signingConfigs {
        release {
            storeFile file(rootProject.file("keystore"))
            storePassword '123456'
            keyAlias 'android_aop'
            keyPassword '123456'
        }
    }
    flavorDimensions.add("env")
    productFlavors {
        informal {
            dimension "env"
            signingConfig signingConfigs.release
        }
        product {
            dimension "env"
            signingConfig signingConfigs.release
        }
    }

    buildTypes {
        debug {
            ext.enableCrashlytics = false
            signingConfig signingConfigs.release
            shrinkResources false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        release {
            signingConfig signingConfigs.release
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

        }
    }


    packagingOptions {
        exclude 'META-INF/kotlinx_coroutines_core.version'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'license/README.dom.txt'
        exclude 'license/LICENSE.dom-documentation.txt'
        exclude 'license/NOTICE'
        exclude 'license/LICENSE.dom-software.txt'
        exclude 'license/LICENSE'
    }
    dynamicFeatures = [':dynamicfeature']

}

dependencies {
//    implementation(fileTree("libs"))

    api project(path: ":test-lib")
//    implementation project(path: ":sub-modules:sub1")
//    implementation project(path: ":sub-modules:sub2")
    if (TestType == "-1"){
        //本地
        ksp project(':android-aop-apt')
//        kapt project(':android-aop-apt')
    }else {
//        annotationProcessor 'io.github.flyjingfish:androidaop-apt:'+TestVersion
        ksp 'io.github.flyjingfish:androidaop-apt:'+TestVersion
    }
    debugImplementation libs.leakcanary
    implementation libs.bcprov.jdk15on
    implementation "com.squareup.retrofit2:retrofit:2.8.1"

    testImplementation libs.junit
    androidTestImplementation libs.androidx.test.ext.junit
    androidTestImplementation libs.espresso.core
    androidTestImplementation libs.androidx.rules

//    implementation 'com.google.android.material:material:1.5.0'
//    implementation 'androidx.appcompat:appcompat:1.6.1'
//    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
//    implementation 'com.google.protobuf:protobuf-javalite:3.13.0'
//    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
//    implementation 'com.github.bumptech.glide:annotations:4.11.0'
//    implementation 'com.github.bumptech.glide:glide:4.11.0'
//    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20'
//    implementation 'org.jetbrains.kotlin:kotlin-reflect:1.7.20'
//    implementation 'androidx.core:core-ktx:1.8.0'
//    implementation 'com.google.android.exoplayer:exoplayer-core:2.17.1'
//    implementation 'com.google.android.exoplayer:exoplayer-ui:2.17.1'
//    implementation 'com.google.crypto.tink:tink-android:1.5.0'
//    implementation 'com.google.code.gson:gson:2.8.1'
//    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
//    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
//    implementation 'androidx.activity:activity-ktx:1.4.0'
//    implementation 'androidx.fragment:fragment-ktx:1.4.1'
//    implementation 'androidx.viewpager2:viewpager2:1.0.0'
//    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
//    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0'
//    implementation 'androidx.navigation:navigation-ui-ktx:2.5.0'
//    implementation 'org.greenrobot:eventbus:3.1.1'
}
apply from: "$rootDir/gradle/deleteOccupancy.gradle"