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

def siteUrl = 'https://github.com/easemob/kefu-android-demo' //项目在github主页的地址
def gitUrl = 'https://github.com/easemob/kefu-android-demo.git' //Git仓库的地址


def easeuiProjectName = 'kefu-easeui-android'

project.archivesBaseName = easeuiProjectName

group = "com.hyphenate" //groupId
version = project.easeuiVersion //release aar sdkversion

install{
    repositories.mavenInstaller {
        // This generates POM.xml with proper parameters
        pom {
            project {
                packaging 'aar'
                name easeuiProjectName // 添加项目描述
                artifactId easeuiProjectName //默认使用module名称
                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 'liyuzhao' //设置自己ID
                        name 'liyuzhao' //设置自己名称
                        email 'liyuzhao@easemob.com' //设置自己邮箱
                    }
                }
                scm {
                    connection gitUrl
                    developerConnection gitUrl
                    url siteUrl
                }
            }
        }
    }

}

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

task javadoc(type: Javadoc){
    options {
        encoding 'UTF-8'
        charSet 'UTF-8'
    }
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

javadoc {
    options.showFromPublic()
}

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

artifacts {
    archives javadocJar
    archives sourcesJar
}


//bintray {
//    user = project.getProperty("BINTRAY_USER")
//    key = project.getProperty("BINTRAY_KEY")
//    configurations = ['archives']
//    pkg {
//        repo = "maven"
//        name = easeuiProjectName //项目在jcenter的名字
//        websiteUrl = siteUrl
//        vcsUrl = gitUrl
//        licenses = ["Apache-2.0"]
//        publish = true
//    }
//}
