apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven'
apply plugin: com.feelschaotic.upload.UploadPatchPlugin
apply from: rootProject.file('gradle/gradle_mvn_push.gradle')

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"


    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        publishNonDefault false
        debug {
            // 可能测试环境和正式环境分离 到时候再扩展吧
            buildConfigField "String", "HOTFIX_SERVER_URL", "\"https://api.bmob.cn/1/functions/\""
            buildConfigField "String", "REST_API_KEY", "\"02ab887dd4c57015d8e346b5a728c569\""
            buildConfigField "String", "BMOB_APPLICATION_ID", "\"960a7aa0e24065f4804242fb1e64a7f3\""
            buildConfigField "String", "ACCESS_ID", "\"LTAI4Fx9ecT1eH86xzRKt2Yc\""
            buildConfigField "String", "BUCK_NAME", "\"sdkhotfix-app\""
            buildConfigField "String", "SECRET_KEY", "\"JtMMOLEtwxTZe31soVgKGpVbwovUP8\""
            buildConfigField "String", "END_POINT", "\"https://oss-cn-shenzhen.aliyuncs.com\""
        }
        release {
            buildConfigField "String", "HOTFIX_SERVER_URL", "\"https://api.bmob.cn/1/functions/\""
            buildConfigField "String", "REST_API_KEY", "\"02ab887dd4c57015d8e346b5a728c569\""
            buildConfigField "String", "BMOB_APPLICATION_ID", "\"960a7aa0e24065f4804242fb1e64a7f3\""
            buildConfigField "String", "ACCESS_ID", "\"LTAI4Fx9ecT1eH86xzRKt2Yc\""
            buildConfigField "String", "BUCK_NAME", "\"sdkhotfix-app\""
            buildConfigField "String", "SECRET_KEY", "\"JtMMOLEtwxTZe31soVgKGpVbwovUP8\""
            buildConfigField "String", "END_POINT", "\"https://oss-cn-shenzhen.aliyuncs.com\""
            minifyEnabled isProguard.toBoolean()
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility 1.7
        targetCompatibility 1.7
    }

    repositories {
        flatDir {
            dirs 'libs'
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:27.1.1'
    testCompile 'junit:junit:4.12'

    compile 'com.tencent:mmkv:1.0.10'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    compile 'com.alibaba:fastjson:1.2.46'
    compile 'com.squareup.okhttp3:okhttp:3.4.0'
    compile 'com.squareup.okio:okio:1.12.0'
    compile 'com.github.feelschaotic:Robust.patch:0.4.87.5-RELEASE'
    compile 'com.aliyun.dpa:oss-android-sdk:2.9.2'
    compile 'com.feelschaotic.sdk:crypto:1.0'

    compile "io.reactivex.rxjava2:rxjava:2.2.2"
    compile 'io.reactivex.rxjava2:rxandroid:2.1.0'
    compile 'com.google.code.gson:gson:2.8.5'
}
repositories {
    mavenCentral()
}