import java.time.Duration

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

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.3'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 29
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        abortOnError false
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
}

configurations.all {
    // check for updates every build
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}


dependencies {
    api "io.cucumber:cucumber-java:4.8.1"
    api "io.cucumber:cucumber-junit:4.8.1"
    api 'junit:junit:4.13'
    api "androidx.test:runner:1.2.0"
    testImplementation "org.robolectric:robolectric:4.3.1"
    testImplementation "org.powermock:powermock-api-mockito2:2.0.2"
    testImplementation "org.powermock:powermock-module-junit4:2.0.2"
    testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

task("generateJavadoc", type: Javadoc, group: 'documentation') {
    source = android.sourceSets.main.java.srcDirs
    destinationDir = new File("${project.buildDir}/javadoc")
    options.addStringOption('Xdoclint:none', '-quiet')
}

task javadocJar(type: Jar, dependsOn: generateJavadoc) {
    archiveClassifier.set 'javadoc'
    from generateJavadoc.destinationDir
}

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    archiveClassifier.set 'sources'
}


