apply plugin: 'com.android.library'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
//apply plugin: 'com.google.devtools.ksp'
apply plugin: "com.vanniktech.maven.publish"

android {
    namespace "com.airbnb.paris"
    compileSdkVersion rootProject.COMPILE_SDK_VERSION

    defaultConfig {
        minSdkVersion rootProject.MIN_SDK_VERSION
        targetSdkVersion rootProject.TARGET_SDK_VERSION
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }

    lintOptions {
        warningsAsErrors true
        // We use R2 to keep resource ids constant
        disable 'NonConstantResourceId'
        // UnusedResources has false positives
        disable 'UnusedResources'
    }

    compileOptions {
        sourceCompatibility rootProject.JAVA_SOURCE_VERSION
        targetCompatibility rootProject.JAVA_TARGET_VERSION
    }

    kotlinOptions {
        jvmTarget = '11'
    }


}

dependencies {
    implementation deps.appcompat

    api project(':paris-annotations')

    kapt project(':paris-processor')
    kaptTest project(':paris-processor')

    testImplementation deps.junit
    testImplementation deps.kotlinTest
    testImplementation deps.mockitoCore
    testImplementation deps.robolectric


    androidTestImplementation deps.mockitoAndroid
    androidTestImplementation deps.espresso
}

kotlin {
    sourceSets {
        // Required for KSP to work with butterknife gradle plugin codegen of R2
//        main.kotlin.srcDirs += 'build/generated/source/r2/debug'
//        main.kotlin.srcDirs += 'build/generated/source/r2/release'

        // Required for KSP to work with unit tests
//        test.kotlin.srcDirs += 'build/generated/ksp/debugUnitTest/kotlin'
    }
}
