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

group='com.github.jitpack'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        consumerProguardFiles 'proguard-rules.pro'
    }
}

dependencies {
    // add dependencies here
}

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

task javadoc(type: Javadoc) {
    failOnError  false
    source = android.sourceSets.main.java.sourceFiles
    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
}

// uncomment to build a jar file in addition to the default aar file
//android.libraryVariants.all { variant ->
//    def name = variant.buildType.name
//    def task = project.tasks.create "jar${name.capitalize()}", Jar
//    task.dependsOn variant.javaCompile
//    task.from variant.javaCompile.destinationDir
//    artifacts.add('archives', task);
//}

