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

android {
    namespace 'org.hydev.wearsync'
    compileSdk 33

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

    defaultConfig {
        applicationId "org.hydev.wearsync"
        minSdk 26
        targetSdk 33
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "aarch64", "armeabi", "arm64", "x86", "x86_64"
        }

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    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'
    }

    buildFeatures {
        viewBinding true
    }
}

dependencies {
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.6.0'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
    implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
    implementation 'androidx.preference:preference:1.2.0'

    // https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-reflect
    implementation "org.jetbrains.kotlin:kotlin-reflect:1.8.0"

    // Logger
    implementation 'com.jakewharton.timber:timber:5.0.1'

    // BLE Library
    implementation "com.github.weliem:blessed-android-coroutines:0.3.2"

    // Database library
    implementation "com.influxdb:influxdb-client-kotlin:6.3.0"
    implementation "org.jetbrains.exposed:exposed-core:0.40.1"
    implementation "org.jetbrains.exposed:exposed-dao:0.40.1"
    implementation "org.jetbrains.exposed:exposed-jdbc:0.40.1"

    // !IMPORTANT! Make sure to update native so when updating sqlite-jdbc
    // Copy from sqlite-jdbc-3.40.0.0.jar!/org/sqlite/native/Linux-Android to app/libs
    // ln -s arm armeabi
    // ln -s arm armeabi-v7a
    // ln -s aarch64 arm64
    // ln -s aarch64 arm64-v8a
    implementation 'org.xerial:sqlite-jdbc:3.40.0.0'

    // Root library
    implementation "com.github.topjohnwu.libsu:core:5.0.4"
    implementation "com.github.topjohnwu.libsu:service:5.0.4"

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}