apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
// 对kotlin生成doc
apply plugin: 'org.jetbrains.dokka'
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

android {
    compileSdkVersion rootProject.ext.android.compileSdkVersion

    defaultConfig {
        minSdkVersion rootProject.ext.android.minSdkVersion
        targetSdkVersion rootProject.ext.android.targetSdkVersion

        versionCode 1
        versionName "1.0"

        consumerProguardFiles "consumer-rules.pro"

        ndk {
            abiFilters "arm64-v8a"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    dokka {
        outputFormat = 'javadoc'
        outputDirectory = "$rootDir/ApiDoc/foudations/commons"

        configuration {
            // Do not output deprecated members
            skipDeprecated = true
            // Emit warnings about not documented members.
            reportUndocumented = true
            // Do not create index pages for empty packages
            skipEmptyPackages = true

            noJdkLink = true
            noStdlibLink = true
            noAndroidSdkLink = true
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation rootProject.ext.dependencies.kotlinstdlibjdk7

    api rootProject.ext.dependencies.retrofit
    api rootProject.ext.dependencies.retrofitadapter
    api rootProject.ext.dependencies.retrofitconvertergson
    api rootProject.ext.dependencies.retrofitconverterscalars
    compileOnly 'com.elegant.network:network:1.1.28'
    implementation files('libs/cronet_api.jar')
    implementation files('libs/cronet_impl_common_java.jar')
    implementation files('libs/cronet_impl_native_java.jar')
    implementation 'com.google.guava:guava:29.0-android'

    if (Boolean.valueOf(RELEASE)) {
        api "com.mogo.cloud:passport:${MOGO_PASSPORT_VERSION}"
    } else {
        api project(path: ':foudations:mogo-passport')
    }

}