plugins {
    id "com.jfrog.bintray" version "1.2"
}

apply plugin: 'java'
//apply plugin: 'maven'
apply plugin: 'maven-publish'

sourceCompatibility = 1.7
version = '1.0.1'

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
    testCompile 'org.mockito:mockito-core:2.0.5-beta'
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.3'
}


//sources and java doc
task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}


//MAVEN
publishing {
    publications {
        releaseJar(MavenPublication) {
            from components.java
            groupId 'couk.doridori.dynamo'
            artifactId 'dynamo'

        }
    }
}


bintray {
    user = 'doridori'
    key = 'enterKey!'
    publications = ['MyPublication']

    configurations = ['archives']

    dryRun = true
    publish = true //If version should be auto published after an upload
    pkg {
        repo = 'maven'
        name = 'Dynamo'
        version {
            name='1.0.1'
        }
    }
}

publishing {
    publications {
        MyPublication(MavenPublication) {
            from components.java
            groupId 'co.uk.doridori'
            artifactId 'dynamo'
            version '1.0.1'
        }
    }
}