apply plugin: 'com.android.library'

android {
    compileSdkVersion 30
    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 30
        versionCode 1020000
        versionName "1.2.0"
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation 'com.fasterxml.jackson.core:jackson-databind:2.12.1'
    androidTestImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    implementation 'androidx.annotation:annotation:1.1.0'
}

/////////////////////////////////
// bintray configuration below //

apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

// bintray username and API key come from this file
if (file('local.gradle').exists())
    apply from: 'local.gradle'

group = 'com.einmalfel'
version = '1.2.0'

task generateSourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier 'sources'
}

task generateJavadocs(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task generateJavadocsJar(type: Jar, dependsOn: generateJavadocs) {
    from generateJavadocs.destinationDir
    classifier 'javadoc'
}

artifacts {
    archives generateJavadocsJar, generateSourcesJar
}

bintray {
    pkg {
        repo = 'maven'
        name = project.name
        desc = 'Easy Android RSS Library'
        issueTrackerUrl = 'https://github.com/einmalfel/Earl/issues'
        licenses = ["LGPL-3.0"]
        vcsUrl = 'https://github.com/einmalfel/Earl.git'
        websiteUrl = 'https://github.com/einmalfel/Earl'
        publicDownloadNumbers = false
        labels = ['Android', 'RSS', 'Atom', 'syndication', 'parser', 'library']

        version {
            name = project.version
            released = new Date()
            desc = 'Initial version'
            vcsTag = project.version
        }

    }
    configurations = ['archives']
}
