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.guidepage'

    compileSdk cfg.android.compileSdkVersion

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

        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
        buildConfig = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            buildConfigField("boolean","isModule",String.valueOf(cfg.isModule))
        }
        debug {
            buildConfigField("boolean","isModule",String.valueOf(cfg.isModule))
        }
    }
}

dependencies {
    implementation 'com.github.Chrisvin:LiquidSwipe:1.3'

    api 'com.alibaba:arouter-api:1.5.2'
    annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
}