apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: '../scripts/build_detekt.gradle'
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'


android {
    ndkVersion "21.1.6352462"
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "net.qaul.app"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        externalNativeBuild { cmake { cppFlags "-std=c++14" } }
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions { jvmTarget = "1.8" }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'com.android.support:support-annotations:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'android.arch.lifecycle:extensions:1.1.1'
    implementation 'android.arch.navigation:navigation-fragment:1.0.0'
    implementation 'android.arch.navigation:navigation-ui:1.0.0'
    implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0'
    implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0'
    implementation 'androidx.preference:preference:1.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    // Koin for Android
    koin_version = "2.1.5"
    compile "org.koin:koin-android:$koin_version"
    compile "org.koin:koin-androidx-scope:$koin_version"
    compile "org.koin:koin-androidx-viewmodel:$koin_version"
    compile "org.koin:koin-androidx-fragment:$koin_version"

    implementation 'com.mikhaellopez:circularimageview:4.2.0'
}

cargo {
    module = "../../../utils/android-support"
    targetDirectory = "../../../target"
    libname = "qauldroid"
    targetIncludes = ['libqauldroid.so']
    targets = ["arm64"]
}

buildscript {
    ext.kotlin_version = '1.3.72'
    ext.koin_version = "2.1.5"
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

repositories {
    mavenCentral()
}
