apply from: rootProject.file('cc-settings.gradle')
apply plugin: 'com.jakewharton.butterknife'

android {
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]

    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }
    // 避免 lint 检测出错时停止构建
    lintOptions {
        abortOnError false
    }
    defaultConfig {
        if (project.ext.runAsApp) {
            applicationId "com.gingersoft.gsa.cloud.download"
        }
        minSdkVersion rootProject.ext.android["minSdkVersion"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]
        versionCode rootProject.ext.android["versionCode"]
        versionName rootProject.ext.android["versionName"]
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles 'consumer-rules.pro'
        multiDexEnabled true
        //配置注解处理器
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
    }

    resourcePrefix "download_data"

    buildTypes {
        debug {
            buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"]
            buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["debugUseCanary"]
            minifyEnabled false
            proguardFiles 'proguard.cfg'
        }

        release {
            buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["releaseLogDebug"]
            buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["releaseUseCanary"]
            minifyEnabled false
            shrinkResources false
            zipAlignEnabled false
            proguardFiles 'proguard.cfg'
        }
    }

    lintOptions {
        disable 'InvalidPackage'
        disable "ResourceType"
        abortOnError false
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
//    if (project.ext.runAsApp) {
    annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
    debugImplementation rootProject.ext.dependencies["canary-debug"]
    releaseImplementation rootProject.ext.dependencies["canary-release"]
    testImplementation rootProject.ext.dependencies["canary-release"]
//    }else {
//        compileOnly rootProject.ext.dependencies["dagger2-compiler"]
//        compileOnly rootProject.ext.dependencies["canary-debug"]
//        compileOnly rootProject.ext.dependencies["canary-release"]
//        compileOnly rootProject.ext.dependencies["canary-release"]
//    }
    api rootProject.ext.dependencies["butterknife"]
    testImplementation rootProject.ext.dependencies["junit"]
}
