plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'kotlinx-serialization'
    id 'com.google.devtools.ksp'
    id 'com.google.dagger.hilt.android'
}

android {
    compileSdkVersion androidCompileSdkVersion

    defaultConfig {
        minSdkVersion androidMinimumSdkVersion

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        // The following argument makes the Android Test Orchestrator run its
        // "pm clear" command after each test invocation. This command ensures
        // that the app's state is completely cleared between tests.
        testInstrumentationRunnerArguments clearPackageData: 'true'
        testOptions {
            execution 'ANDROIDX_TEST_ORCHESTRATOR'
        }

        sourceSets {
            test {
                java.srcDirs = ['src/AndroidTest/java/org/session/libsession']
            }
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    namespace 'org.session.libsession'
}

dependencies {
    implementation project(":libsignal")
    implementation project(":libsession-util")
    implementation project(":liblazysodium")

    implementation("com.google.dagger:hilt-android:$daggerHiltVersion")
    ksp("com.google.dagger:hilt-compiler:$daggerHiltVersion")
    ksp("androidx.hilt:hilt-compiler:$jetpackHiltVersion")

    implementation "net.java.dev.jna:jna:5.12.1@aar"
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
    implementation "androidx.core:core-ktx:$coreVersion"
    implementation "androidx.appcompat:appcompat:$appcompatVersion"
    implementation "androidx.preference:preference-ktx:$preferenceVersion"
    implementation "com.google.android.material:material:$materialVersion"
    implementation "com.google.protobuf:protobuf-java:$protobufVersion"
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    implementation "com.github.bumptech.glide:glide:$glideVersion"
    implementation 'com.annimon:stream:1.1.8'
    implementation 'com.makeramen:roundedimageview:2.1.0'
    implementation 'com.esotericsoftware:kryo:5.1.1'
    implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
    implementation "com.github.oxen-io.session-android-curve-25519:curve25519-java:$curve25519Version"
    implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
    implementation "com.squareup.phrase:phrase:$phraseVersion"
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxJsonVersion"
    implementation "nl.komponents.kovenant:kovenant:$kovenantVersion"

    // Note: kotlinx-datetime:0.6.0 is the latest version as of 2024/08/09 -AL
    implementation 'org.jetbrains.kotlinx:kotlinx-datetime:0.6.0'

    testImplementation "junit:junit:$junitVersion"
    testImplementation 'org.assertj:assertj-core:3.11.1'
    testImplementation "org.mockito:mockito-inline:4.11.0"
    testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
    testImplementation "androidx.test:core:$testCoreVersion"
    testImplementation "androidx.arch.core:core-testing:2.1.0"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"
    testImplementation "org.conscrypt:conscrypt-openjdk-uber:2.0.0"
    implementation 'org.greenrobot:eventbus:3.0.0'
}