From 99bff87136368eb0195ddd74e42259689da402f9 Mon Sep 17 00:00:00 2001 From: Michael Rozumyanskiy Date: Sat, 2 Apr 2016 21:13:28 +0300 Subject: [PATCH] Configure Bintray publishing --- build.gradle | 55 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index ece1d3b..b652fcd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,3 @@ -group 'io.michaelrocks' -version '1.0.0' - buildscript { ext.kotlinVersion = '1.0.1-2' repositories { @@ -11,9 +8,16 @@ buildscript { } } +plugins { + id "com.jfrog.bintray" version "1.6" +} + apply plugin: 'java' apply plugin: 'kotlin' +apply plugin: 'maven-publish' +group 'io.michaelrocks' +version '1.0.0' sourceCompatibility = 1.6 repositories { @@ -24,3 +28,48 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" testCompile 'junit:junit:4.12' } + +bintray { + user = project.property('bintrayUser') + key = project.property('bintrayKey') + publications = ['mavenJava'] + + pkg { + repo = 'maven' + name = 'bimap' + + version { + name = project.version + released = new Date() + vcsTag = "v${project.version}" + } + } +} + +task sourcesJar(type: Jar, dependsOn: project.classes) { + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: project.javadoc) { + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar, javadocJar +} + +publishing { + publications { + mavenJava(MavenPublication) { + artifactId project.bintray.pkg.name + from components.java + + artifact sourcesJar { + classifier = 'sources' + } + artifact javadocJar { + classifier = 'javadoc' + } + } + } +}