apply from: file('./../gradle/constants.gradle')

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

android {
    compileSdkVersion project.ext.compileSdkVersion
    buildToolsVersion project.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion project.ext.minSdkVersion
        targetSdkVersion project.ext.targetSdkVersion

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

    // https://issuetracker.google.com/issues/185418482
    lintOptions{
        abortOnError false
    }

    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 = JavaVersion.VERSION_1_8.toString()
    }
    namespace 'com.applicaster.xray.ui'
}

dependencies {
    xrayAPI(dependencies, ':xray-core')
    xrayAPI(dependencies, ':xray-crashreporter')

    implementation 'androidx.recyclerview:recyclerview:1.3.2'

    implementation 'com.google.code.gson:gson:2.10.1'

    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.0'
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

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

}

project.ext {
    ARTIFACT_ID="xray-ui"
    ARTIFACT_FILE_NAME="xray-ui"
    POM_DESCRIPTION="Applicaster XRay UI Extensions"
}

if(rootProject.ext.has('xRayPublishing')) {
    apply from: file('./../gradle/publish.gradle')
}
