buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
    }
}

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

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.0'
}
group = 'com.albinmathew'
version = '1.0.3'


apply plugin: 'maven'
apply plugin: 'maven-publish'


def siteUrl = 'https://github.com/albinmathew/PhotoCrop'
def gitUrl = 'https://github.com/albinmathew/PhotoCrop.git'
bintray {
    user = "albinmathew"
    if (file("key").exists()) {
        key = file("key").text
    }

    configurations = ['archives']
    publish = true
    pkg {
        repo = 'maven'
        name = 'PhotoCrop'
        desc = 'A Library which can be used to crop images in Android similar to Facebook and Telegram'
        websiteUrl = siteUrl
        issueTrackerUrl = 'https://github.com/albinmathew/PhotoCrop/issues'
        vcsUrl = gitUrl
        licenses = ['Apache-2.0']
        labels = ['aar', 'android', 'photo crop']
        publicDownloadNumbers = true
    }
}



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

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

}

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

