diff --git a/build.gradle b/build.gradle index 1c9281d3..fbdb6534 100644 --- a/build.gradle +++ b/build.gradle @@ -8,12 +8,14 @@ plugins { id 'pl.allegro.tech.build.axion-release' version '1.8.1' id "com.github.hierynomus.license" version "0.12.1" id "com.jfrog.bintray" version "1.7" - id 'ru.vyarus.pom' version '1.0.3' + id 'ru.vyarus.java-lib' version '1.0.5' + // id 'ru.vyarus.pom' version '1.0.3' id 'ru.vyarus.github-info' version '1.1.0' id 'ru.vyarus.animalsniffer' version '1.4.2' } group = "com.hierynomus" + defaultTasks "build" repositories { @@ -64,6 +66,10 @@ scmVersion { prefix = 'v' versionSeparator = '' } + hooks { + pre 'fileUpdate', [file: 'README.adoc', pattern: { v, c -> /:sshj_version: .*/}, replacement: { v, c -> ":sshj_version: $v" }] + pre 'commit' + } } project.version = scmVersion.version @@ -85,7 +91,6 @@ task writeSshjVersionProperties { } jar.dependsOn writeSshjVersionProperties - jar { manifest { // please see http://bnd.bndtools.org/chapters/390-wrapping.html @@ -106,14 +111,7 @@ jar { } } -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource +sourcesJar{ manifest { attributes( // Add the needed OSGI attributes @@ -192,21 +190,12 @@ pom { } } -publishing.publications { - Sshj(MavenPublication) { - from components.java - artifact sourcesJar - artifact javadocJar - } -} - - if (project.hasProperty("bintrayUsername") && project.hasProperty("bintrayApiKey")) { bintray { user = project.property("bintrayUsername") key = project.property("bintrayApiKey") publish = true - publications = ["Sshj"] + publications = ["maven"] pkg { repo = "maven" name = project.name @@ -233,4 +222,5 @@ if (project.hasProperty("bintrayUsername") && project.hasProperty("bintrayApiKey } } -project.tasks.release.dependsOn([project.tasks.build, project.tasks.bintrayUpload]) +project.tasks.release.dependsOn(project.tasks.build) +project.tasks.release.finalizedBy(project.tasks.bintrayUpload)