def cfg = rootProject.ext
if (isModule.booleanValue()) {
    apply plugin: 'com.android.application'
} else {
    apply plugin: 'com.android.library'
}

apply from: "${rootProject.rootDir}/config_build.gradle"

android {
    namespace 'com.xuptggg.detail'
    compileSdk cfg.android.compileSdkVersion

    defaultConfig {
        if (isModule.booleanValue()) {
            applicationId cfg.applicationId.detail
        }

        minSdk cfg.android.minSdkVersion
        targetSdk cfg.android.targetSdkVersion
        versionCode cfg.android.versionCode
        versionName cfg.android.versionName

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [AROUTER_MODULE_NAME: project.getName()]
            }
        }
    }

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

    sourceSets {
        main {
            if (isModule) {
                manifest.srcFile 'src/main/AndroidManifest.xml'
            } else {
                manifest.srcFile 'src/main/release/AndroidManifest.xml'
            }
        }
    }

    buildFeatures {
        viewBinding = true
    }
}

dependencies {
    api 'com.alibaba:arouter-api:1.5.2'
    annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
    implementation project(':modulesBase:libNetwork')
    implementation libs.okhttp
    implementation libs.appcompat
    implementation libs.material
    implementation libs.activity
    implementation libs.constraintlayout
    testImplementation libs.junit
    androidTestImplementation libs.ext.junit
    androidTestImplementation libs.espresso.core
}