apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
            unitTests.returnDefaultValues = true
        }
        unitTests.all {
            useJUnitPlatform()
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // J2V8 Runtime
    api("com.eclipsesource.j2v8:j2v8:6.1.0@aar")
    api("com.github.yinyinnie:stetho:v1.0.0")

    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version")
    implementation("androidx.annotation:annotation:1.1.0")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5")

    testImplementation("org.junit.jupiter:junit-jupiter:5.6.1")
    testImplementation("org.json:json:20190722")
    testImplementation("com.google.guava:guava:25.1-android")
    testImplementation("io.mockk:mockk:1.10.0")
}

repositories {
    mavenCentral()
}
