if (isBuildModule.toBoolean()) {
    apply plugin: 'com.android.application'
} else {
    apply plugin: 'com.android.library'
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

kapt {
    arguments {
        arg("AROUTER_MODULE_NAME", project.getName())
    }
}

android {
    compileSdkVersion 31

    sourceSets {
        main{
            // 应用
            if(isBuildModule.toBoolean()){
                manifest.srcFile 'src/main/debug/AndroidManifest.xml'
            }else{// 插件
                manifest.srcFile 'src/main/release/AndroidManifest.xml'
            }
        }
    }

    defaultConfig {
        if (isBuildModule.toBoolean()) {
            applicationId "com.lukouguoji.mit"
        }
        minSdkVersion 24
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildToolsVersion '30.0.3'

    buildFeatures {
        dataBinding = true
    }
}

dependencies {
    api project(':module_base')

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    kapt 'com.alibaba:arouter-compiler:1.5.2'
}