apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply from: '../upload.gradle'

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

    defaultConfig {
        minSdkVersion rootProject.ext.android["minSdkVersion_16"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]
        versionCode rootProject.ext.android["versionCode"]
        versionName rootProject.ext.android["versionName"]

        lintOptions {
            abortOnError false
        }
    }

    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }

    /**
     * 支持ViewBinding
     */
    buildFeatures {
        //viewBinding = true
    }


    kotlinOptions {
        jvmTarget = "1.8"
    }

}



dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    if (needKotlinV14()) {
        compileOnly rootProject.ext.dependencies["kotlin_v14"]
    } else {
        compileOnly rootProject.ext.dependencies["kotlin_v13"]
    }
    implementation rootProject.ext.dependencies["appcompat"]
    implementation rootProject.ext.dependencies["constraintLayout"]
    implementation rootProject.ext.dependencies["material"]
    compileOnly project(':dokit-util')
    api project(':dokit')
    compileOnly rootProject.ext.dependencies["weex_inspector"]
    compileOnly rootProject.ext.dependencies["weex_sdk"]
    //auto-service
    implementation rootProject.ext.dependencies["auto_service"]
    kapt rootProject.ext.dependencies["auto_service"]
}
repositories {
    mavenCentral()
}


//def PUBLISH_ARCHIVES_TYPE = rootProject.ext.publish_config["archives_type"]
//if (PUBLISH_ARCHIVES_TYPE == 0 || PUBLISH_ARCHIVES_TYPE == 1) {
//
//    publish.mustRunAfter {
//
//    }
//
//    publish.dependsOn([
//            ':dokit-no-op:publish',
//            ':dokit-util:publish',
//            ':dokit-plugin:publish',
//            ':dokit-okhttp-v3:publish',
//            ':dokit-okhttp-v4:publish',
//            ':dokit-okhttp-api:publish',
//            ':dokit:publish',
//            ':dokit-mc:publish',
//            ':dokit-ft:publish',
//            ':dokit-rpc:publish',
//            ':dokit-rpc-mc:publish'
//    ])
//}


