apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.3'

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            testCoverageEnabled true
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    testCompile "org.robolectric:robolectric:3.3.2"
    testCompile "org.robolectric:shadows-support-v4:3.3.2"
    compile 'com.android.support:appcompat-v7:25.3.1'
}

def isReleaseBuild() {
    return VERSION_NAME.contains("SNAPSHOT") == false
}

def getReleaseRepositoryUrl() {
    return hasProperty("RELEASE_REPOSITORY_URL") ? RELEASE_REPOSITORY_URL : ""
}

def getSnapshotRepositoryUrl() {
    return ghasProperty("SNAPSHOT_REPOSITORY_URL") ? SNAPSHOT_REPOSITORY_URL : ""
}

def getRepositoryUsername() {
    return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
    return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

tasks.withType(Javadoc) {
    failOnError false
}

ext {
    bintrayRepo = 'Reamp'
    bintrayName = 'Reamp'
    bintrayOrg = 'eastbanctechru'

    publishedGroupId = 'etr.android.reamp'
    libraryName = 'Reamp'
    artifact = 'reamp'

    libraryDescription = 'Reamp'

    siteUrl = 'https://github.com/eastbanctechru/Reamp'
    gitUrl = 'https://github.com/eastbanctechru/Reamp.git'

    libraryVersion = '1.0.2'

    developerId = 'eastbanctechru'
    developerName = 'EastBanc Technologies'
    developerEmail = 'info@eastbanctech.ru'

    licenseName = 'The MIT License'
    licenseUrl = 'https://opensource.org/licenses/MIT'
    allLicenses = ["MIT"]
}

apply from: '../jacoco.gradle'

if (project.rootProject.file('local.properties').exists()) {
    apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
    apply from: './bintray.gradle'
}
