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

group = 'com.github.douglasjunior'

android {
    compileSdkVersion 30

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 30
        versionCode 9
        versionName "0.2.3"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
    }
}

dependencies {
    api 'androidx.annotation:annotation:1.1.0'
}

// build a jar with source files
task sourcesJar(type: Jar) {
    //noinspection GroovyAssignabilityCheck
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

task javadoc(type: Javadoc) {
    failOnError false
    source = android.sourceSets.main.java.sourceFiles
    //noinspection GroovyAssignabilityCheck
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    classpath += configurations.compile
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}
