apply plugin: 'com.android.library'
apply from: "../gradle_component/baseconfig.gradle"
android {

    defaultConfig {
        versionName "2.9.11 Stable"
    }
}

dependencies {
    api fileTree(include: ['*.jar'], dir: 'libs')
    api project(':IMKit')
}

//生成 jar 名字
def JAR_NAME = "Sight"
//生成 jar 路径
def OUTPUT_PATH = "build/libs/"

//执行 gradle makeJar 后生成发布的 Sight.jar
task makeJar(type: Jar) {
    //Sight.jar
    from zipTree(file('build/intermediates/intermediate-jars/release/classes.jar'))

    //去除编译生成的临时文件
    exclude('**/BuildConfig.class')
    exclude('**/BuildConfig\$*.class')
    exclude('**/R.class')
    exclude('**/R\$*.class')
    exclude('**/*_version')

    baseName JAR_NAME
    destinationDir file(OUTPUT_PATH)
}

task clearJar(type: Delete) {
    delete OUTPUT_PATH + JAR_NAME + '.jar'
}

makeJar.dependsOn(clearJar, build)