group 'com.saladevs'
version '0.2.0'

buildscript {
    ext {
        kotlin_version = '1.2.30'
        rxjava_version = '2.1.10'
        okhttp_version = '3.10.0'
        bintray_version = '1.8.0'
    }
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
    }
}

apply plugin: 'kotlin'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile "io.reactivex.rxjava2:rxjava:$rxjava_version"
    compile "com.squareup.okhttp3:okhttp:$okhttp_version"
}

compileKotlin { kotlinOptions.jvmTarget = '1.6' }
compileTestKotlin { kotlinOptions.jvmTarget = '1.6' }

task sourcesJar(type: Jar) {
    classifier = 'sources'
    from sourceSets.main.allSource
}
jar.dependsOn(sourcesJar)

bintray {
    user = BINTRAY_USER
    key = BINTRAY_KEY
    configurations = ['archives']
    publications = ['myPublication']
    pkg {
        repo = 'RxSSE'
        name = 'RxSSE'
        userOrg = 'saladevs'
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/EnricSala/RxSSE.git'
        version {
            name = '0.2.0'
            desc = 'Minor improvements'
            released = new Date()
            vcsTag = 'v0.2.0'
        }
    }
}

publishing {
    publications {
        myPublication(MavenPublication) {
            from components.java
            artifact sourcesJar
            groupId 'com.saladevs'
            artifactId 'rxsse'
            version '0.2.0'
        }
    }
}
