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

version = "1.1.3"

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 14
        //noinspection OldTargetApi
        targetSdkVersion 28
        versionCode 3
        versionName version
        vectorDrawables.useSupportLibrary = true
    }
    lintOptions {
        abortOnError false
        checkReleaseBuilds false
    }
    resourcePrefix "gallery_"
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
dependencies {
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.exifinterface:exifinterface:1.1.0'

    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.15'
    implementation 'com.github.yalantis:ucrop:2.2.4'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.facebook.fresco:fresco:2.0.0'
    implementation 'com.facebook.fresco:animated-gif:2.0.0'
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
}
def siteUrl = 'https://github.com/FinalTeam/RxGalleryFinal'
def gitUrl = 'https://github.com/FinalTeam/RxGalleryFinal.git'
group = "cn.finalteam.rxgalleryfinal"
install {
    repositories.mavenInstaller {
        pom {
            project {
                packaging 'aar'
                name 'RxGalleryFinal'
                description = 'dujinyang desc'
                url siteUrl
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id 'dujinyang'
                        name 'dujinyang'
                        email '309933706@qq.com'
                    }
                }
                scm {
                    connection gitUrl
                    developerConnection gitUrl
                    url siteUrl
                }
            }
        }
    }
}

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

artifacts {
    archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
    user = properties.getProperty("bintray.user")
    key = properties.getProperty("bintray.apikey")

    configurations = ['archives']
    pkg {
        repo = "maven"
        name = "RxGalleryFinal"
        websiteUrl = siteUrl
        vcsUrl = gitUrl
        licenses = ["Apache-2.0"]
        publish = true
        version {
            gpg {
                passphrase = properties.getProperty("bintray.gpg.password")
            }
        }
    }
}
