apply plugin: 'android-library'
apply plugin: 'maven'
apply plugin: 'signing'

version = "3.14.2"
group = "com.github.androidsocialnetworks"

dependencies {
    compile 'com.android.support:support-v4:20.+'
    compile files('libs/bolts.jar')
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }
}

configurations {
    archives {
        extendsFrom configurations.default
    }
}

signing {
    required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
    sign configurations.archives
}

uploadArchives {
    configuration = configurations.archives
    repositories.mavenDeployer {
        beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

        repository(url: sonatypeRepo) {
            authentication(userName: sonatypeUsername,
                    password: sonatypePassword)
        }

        pom.project {
            name 'Android Social Networks - Facebook SDK'
            packaging 'aar'
            description 'Facebook SDK packaged as aar'
            url 'https://github.com/antonkrasov/AndroidSocialNetworks'

            scm {
                url 'scm:git@github.com:antonkrasov/AndroidSocialNetworks'
                connection 'scm:git@github.com:antonkrasov/AndroidSocialNetworks.git'
                developerConnection 'scm:git@github.com:antonkrasov/AndroidSocialNetworks.git'
            }

            licenses {
                license {
                    name 'The MIT License (MIT)'
                    url 'http://opensource.org/licenses/MIT'
                    distribution 'repo'
                }
            }

            developers {
                developer {
                    id 'anton.krasov'
                    name 'Anton Krasov'
                    email 'anton.krasov@gmail.com'
                }
            }
        }
    }
}