apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'

ext {
    artifactName = 'inlinedimens'
    publishedDescription = 'Android dimension types as inline classes with easy conversions.'
}
version = libraryVersion
apply from: "${rootProject.projectDir}/publish.gradle"

android {
    compileSdkVersion 30

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 30
        versionName version

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

    signingConfigs {
        release {
            storeFile file(keystore)
            storePassword keystorePassword
            keyAlias keyAlias
            keyPassword keyPassword
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
        freeCompilerArgs += ["-XXLanguage:+InlineClasses"]
    }

    testOptions {
        // Used for real Android instances of simple classes, e.g. Point and Rect
        unitTests.includeAndroidResources = true
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.1.0'

    testImplementation 'junit:junit:4.13.2'
    testImplementation 'com.google.truth:truth:1.1.3'
    testImplementation 'org.mockito:mockito-inline:3.10.0'
    testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
    testImplementation 'org.robolectric:robolectric:4.5.1'
}
