/*
 * Copyright (C) 2016 Appflate.io
 *
 *  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.
 */

apply plugin: "com.android.application"
apply from: "../quality_tools/lint.gradle"

android {
    compileSdkVersion rootProject.ext.compileSdk
    buildToolsVersion rootProject.ext.buildTools

    testOptions {
        unitTests.includeAndroidResources = true
    }

    defaultConfig {
        applicationId "io.appflate.restmock.androidsample"
        minSdkVersion rootProject.ext.minSdk
        targetSdkVersion rootProject.ext.targetSdk
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "io.appflate.restmock.androidsample.CustomTestRunner"

        testInstrumentationRunnerArguments = ["notPackage": "org.bouncycastle.pqc.crypto.qtesla"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

configurations.all {
    resolutionStrategy {
        force "androidx.annotation:annotation:1.0.2"
        force "com.squareup.okhttp3:okhttp:$okHttpVersion"
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "androidx.appcompat:appcompat:1.3.1"
    implementation "com.google.android.material:material:1.4.0"
    //noinspection AnnotationProcessorOnCompilePath
    implementation "com.jakewharton:butterknife:$butterKnifeVersion"
    annotationProcessor "com.jakewharton:butterknife-compiler:$butterKnifeVersion"
    implementation "com.google.dagger:dagger:$daggerVersion"
    annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
    implementation "com.squareup.retrofit2:retrofit:2.9.0"
    implementation "com.squareup.retrofit2:converter-gson:2.9.0"
    implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"
    implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"

    implementation "com.google.code.gson:gson:2.8.6"
    implementation "com.google.code.findbugs:annotations:2.0.3"
    compileOnly "javax.annotation:jsr250-api:1.0"

    //Test dependencies
    androidTestImplementation "androidx.test:rules:$androidXTestVersion"
    androidTestImplementation "androidx.test:runner:$androidXTestVersion"

    androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"

    //this dependency tends to break things for most users. Im adding it to check whether the app compiles correctly
    androidTestImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion")
    androidTestImplementation "androidx.annotation:annotation:1.2.0"

    //the most important, RESTMock! :)
    androidTestImplementation project(":android")

    testImplementation "androidx.appcompat:appcompat:1.3.1"
    testImplementation "com.google.android.material:material:1.4.0"
    testImplementation "junit:junit:$junitVersion"
    testImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
    testImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion")
    testImplementation project(":android")
    testImplementation(project(":core"))
}
