/*
 * Copyright 2019 Esri
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'org.jetbrains.dokka-android'
}

apply from: "$rootProject.projectDir/gradle/script/artifact.gradle"

android {
    compileSdkVersion droid.targetSdk

    defaultConfig {
        applicationId "com.esri.arcgisruntime.toolkit"
        minSdkVersion droid.minSdk
        targetSdkVersion droid.targetSdk
        versionCode _versionCode
        versionName _versionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            multiDexKeepProguard file("$rootProject.projectDir/proguard-multidex-rules.pro")
        }
    }
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
    buildFeatures {
        dataBinding = true
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'LICENSE.txt'
    }
}

dokka {
    outputFormat = 'html'
    outputDirectory = "$buildDir/javadoc"
}

dependencies {
    api project(':arcgis-android-toolkit')

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "androidx.appcompat:appcompat:$droid.appcompat"
    implementation "com.google.android.material:material:$droid.material"
    implementation "androidx.vectordrawable:vectordrawable:$droid.vectordrawable"
    implementation "androidx.constraintlayout:constraintlayout:$droid.constraintLayout"
    implementation "androidx.multidex:multidex:$droid.multiDex"
    implementation "androidx.navigation:navigation-fragment-ktx:$droid.nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$droid.nav_version"
    androidTestImplementation "androidx.annotation:annotation:$droid.annotation"
    androidTestImplementation "androidx.test:runner:$droid.testRunner"
    androidTestImplementation "androidx.test.ext:junit:$test.jUnit"
}
