apply plugin: 'com.android.library'
apply plugin: 'jacoco'
apply plugin: 'bintray-release'

def final String VERSION_NAME = "0.12.0-SNAPSHOT"
def final int VERSION_CODE = 14

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 25
        versionCode VERSION_CODE
        versionName VERSION_NAME

        resValue "string", "tray__authority", "legacyTrayAuthority"

        testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        debug {
            // output coverage with ./gradlew clean build createDebugCoverageReport
            testCoverageEnabled true
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    lintOptions {
        abortOnError false
    }

    adbOptions {
        timeOutInMs 300000
    }
}

dependencies {
    compile 'com.android.support:support-annotations:25.3.1'

    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
    androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
    androidTestCompile 'com.android.support.test:runner:0.5'
    testCompile 'org.mockito:mockito-core:1.9.5'
    testCompile 'junit:junit:4.12'
}

// usage:
// ./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false
publish {
    userOrg = 'passsy'
    groupId = 'net.grandcentrix.tray'
    artifactId = 'tray'
    uploadName = 'Tray'
    publishVersion = VERSION_NAME
    description = 'Tray - a SharedPreferences replacement for Android'
    website = 'https://github.com/grandcentrix/tray'
}