buildscript {
    repositories {
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
        mavenCentral()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
//        classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
    }
}

apply plugin: 'com.android.library'

dependencies {
    repositories {
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
        mavenCentral()
        mavenLocal()
    }

    //compile 'io.reactivex:rxandroid:0.24.0'
    //testCompile 'junit:junit:4.10'
    //testCompile 'org.robolectric:robolectric:2.1.+'
    //testCompile 'com.squareup:fest-android:1.0.+'
}

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    lintOptions {
        abortOnError false
    }
}


// SONATYPE DEPLOYMENT
// in order to deploy, run: gradle uploadArchives

apply plugin: 'maven'
apply plugin: 'signing'

version = "0.9.11-SNAPSHOT"
group = "com.eyeem.chips"

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)
        }

        snapshotRepository(url: sonatypeSnapshotRepo) {
            authentication(userName: sonatypeUsername, password: sonatypePassword)
        }

        pom.project {
            name 'Chips'
            packaging 'aar'
            description 'EyeEm style text baloons library'
            url 'https://github.com/eyeem/chips-android'

            scm {
                url 'scm:git@github.com:eyeem/chips-android.git'
                connection 'scm:git@github.com:eyeem/chips-android.git'
                developerConnection 'scm:git@github.com:eyeem/chips-android.git'
            }

            licenses {
                license {
                    name 'The Apache Software License, Version 2.0'
                    url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    distribution 'repo'
                }
            }

            developers {
                developer {
                    id 'vishna'
                    name 'Lukasz Wisniewski'
                    email 'lukasz@eyeem.com'
                }
            }
        }
    }
}
