apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 30
    buildToolsVersion "29.0.3"

    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

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

    packagingOptions {
        pickFirst 'META-INF/AL2.0'
        pickFirst 'META-INF/LGPL2.1'
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }

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

ext {
    timber = "4.7.1"
    coroutines = "1.3.7"
    ankoVersion = "0.10.4"
    mezzanineVersion = '1.2.1'
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.2'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    testImplementation 'junit:junit:4.13.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    implementation project(':adblock-client')

    implementation "com.jakewharton.timber:timber:$timber"

    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines"
    androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines"

    // Anko
    implementation "org.jetbrains.anko:anko-commons:$ankoVersion"
    implementation "org.jetbrains.anko:anko-design:$ankoVersion"

    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1"

    implementation "androidx.work:work-runtime-ktx:2.4.0"

    implementation 'com.github.Edsuns:HttpRequest:0.2'

    implementation "com.github.Edsuns.Mezzanine:mezzanine:$mezzanineVersion"
    kapt "com.github.Edsuns.Mezzanine:mezzanine-compiler:$mezzanineVersion"
}

kapt {
    arguments {
        arg("mezzanine.projectPath", projectDir)
    }
}