apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    namespace "it.airgap.vault"
    compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 31
    defaultConfig {
        applicationId "it.airgap.vault"
        minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
        targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 31
        versionCode 1
        versionName "0.0.0"
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }
    buildTypes {
        debug {
            buildConfigField "boolean", "APPIUM", "false"
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "boolean", "APPIUM", "false"
        }
        appium {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "boolean", "APPIUM", "true"
            matchingFallbacks = ['release']
        }
    }
    buildFeatures {
        buildConfig true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    lint {
        abortOnError false
    }
}

repositories {
    google()
    jcenter()
    flatDir{
        dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
    }
    mavenCentral()
}

dependencies {
    implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
    implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation "androidx.exifinterface:exifinterface:$androidxExifinterfaceVersion"
    implementation project(':capacitor-android')
    implementation 'androidx.webkit:webkit:1.7.0'
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test:core:$androidxTestCoreVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
    implementation project(':capacitor-cordova-android-plugins')

    implementation "com.google.android.material:material:$androidxMaterialVersion"
    implementation 'com.scottyab:rootbeer-lib:0.0.7'

    def fragmentVersion = "1.4.0"
    implementation("androidx.fragment:fragment-ktx:$fragmentVersion")

    def biometricVersion = "1.2.0-alpha05"
    implementation("androidx.biometric:biometric:$biometricVersion")

    def coroutinesVersion = "1.6.0"
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")

    def saplingVersion = "0.0.7"
    implementation "com.github.airgap-it:airgap-sapling:$saplingVersion"

    implementation "org.bouncycastle:bcprov-jdk15on:1.70"

    implementation "androidx.javascriptengine:javascriptengine:1.0.0-alpha03"
    implementation 'com.google.guava:listenablefuture:1.0'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutinesVersion"
}


apply from: 'capacitor.build.gradle'

configurations.all {
    exclude group: 'com.google.firebase', module: ''
    exclude group: 'com.google.android.gms', module: ''
}
