if (isRunModule.toBoolean()) {
    apply plugin: 'com.android.application'
}else {
    apply plugin: 'com.android.library'
}
apply plugin: 'com.jakewharton.butterknife'

android {
    compileSdkVersion rootProject.ext.android.compileSdkVersion

    defaultConfig {
        if (isRunModule.toBoolean()) {
            applicationId "com.zlx.module_public"
        }
        minSdkVersion rootProject.ext.android.minSdkVersion
        targetSdkVersion rootProject.ext.android.targetSdkVersion
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [AROUTER_MODULE_NAME: project.getName()]
            }
        }
        consumerProguardFiles "consumer-rules.pro"
    }

    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 {
            // 1.单独调试与集成调试时使用不同的 AndroidManifest.xml 文件
            // 我们还可以根据不同工程配置不同的 Java 源代码、不同的 resource 资源文件等的
            if (isRunModule.toBoolean()) {
                manifest.srcFile 'src/main/manifest/AndroidManifest.xml'
            } else {
                manifest.srcFile 'src/main/AndroidManifest.xml'
            }
        }
    }
    dataBinding{
        enabled true
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation project(':library-base')
    implementation project(':library-widget')
    implementation project(':library-common')
    implementation project(':library-network')
    annotationProcessor rootProject.ext.dependencies.butterknifeCompiler
    annotationProcessor rootProject.ext.dependencies.arouterCompiler
    if (isRunModule.toBoolean()) {
        implementation project(':module-web')
    }
}