apply plugin: 'com.android.library'

android {
    signingConfigs {
        config {
        }
    }
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 40
        versionName "2.10.1"
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }
    lintOptions {
        abortOnError false
    }
    buildTypes {
//        release {
//            minifyEnabled false
//            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//        }
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.google.zxing:core:3.3.1'

    // 注意：因为微信SDK从4.0.2版本开始已改用gradle形式，后续Android开发工具包将不再更新，请开发者尽快改用gradle方式编译、更新微信SDK
    implementation 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:5.1.6'

    //网络请求库
    implementation 'com.squareup.okhttp3:okhttp:3.8.1'

    testImplementation 'junit:junit:4.12'
    testImplementation "org.mockito:mockito-core:1.10.8"
    testImplementation ('org.powermock:powermock-api-mockito:1.6.6') {
        exclude module: 'hamcrest-core'
        exclude module: 'objenesis'
    }
    testImplementation ('org.powermock:powermock-module-junit4:1.6.6') {
        exclude module: 'hamcrest-core'
        exclude module: 'objenesis'
    }
}

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
    options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}

//以下用于生成sdk jar
//gradle makeJar
task clearJar(type: Delete) {
    delete fileTree(dir: 'build/libs' , include: 'beecloud*.jar')
}

task makeJar(type:org.gradle.api.tasks.bundling.Jar) {
    //指定生成的jar名
    baseName 'beecloud-2.10.1'
    //从哪里打包class文件
    from('build/intermediates/classes/release/cn/beecloud')
    //打包到jar后的目录结构
    into('cn/beecloud')
    //去掉不需要打包的目录和文件
    exclude('test/', 'BuildConfig.class', 'R.class')
    //去掉R$开头的文件
    exclude{ it.name.startsWith('R$')}
}

makeJar.dependsOn(clearJar, build)

