Updated build plugins

This commit is contained in:
Jeroen van Erp
2017-11-09 15:22:34 +01:00
parent b41f0acd19
commit d2e0f50d0c

View File

@@ -8,12 +8,14 @@ plugins {
id 'pl.allegro.tech.build.axion-release' version '1.8.1' id 'pl.allegro.tech.build.axion-release' version '1.8.1'
id "com.github.hierynomus.license" version "0.12.1" id "com.github.hierynomus.license" version "0.12.1"
id "com.jfrog.bintray" version "1.7" 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.github-info' version '1.1.0'
id 'ru.vyarus.animalsniffer' version '1.4.2' id 'ru.vyarus.animalsniffer' version '1.4.2'
} }
group = "com.hierynomus" group = "com.hierynomus"
defaultTasks "build" defaultTasks "build"
repositories { repositories {
@@ -64,6 +66,10 @@ scmVersion {
prefix = 'v' prefix = 'v'
versionSeparator = '' versionSeparator = ''
} }
hooks {
pre 'fileUpdate', [file: 'README.adoc', pattern: { v, c -> /:sshj_version: .*/}, replacement: { v, c -> ":sshj_version: $v" }]
pre 'commit'
}
} }
project.version = scmVersion.version project.version = scmVersion.version
@@ -85,7 +91,6 @@ task writeSshjVersionProperties {
} }
jar.dependsOn writeSshjVersionProperties jar.dependsOn writeSshjVersionProperties
jar { jar {
manifest { manifest {
// please see http://bnd.bndtools.org/chapters/390-wrapping.html // please see http://bnd.bndtools.org/chapters/390-wrapping.html
@@ -106,14 +111,7 @@ jar {
} }
} }
task javadocJar(type: Jar) { sourcesJar{
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
manifest { manifest {
attributes( attributes(
// Add the needed OSGI 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")) { if (project.hasProperty("bintrayUsername") && project.hasProperty("bintrayApiKey")) {
bintray { bintray {
user = project.property("bintrayUsername") user = project.property("bintrayUsername")
key = project.property("bintrayApiKey") key = project.property("bintrayApiKey")
publish = true publish = true
publications = ["Sshj"] publications = ["maven"]
pkg { pkg {
repo = "maven" repo = "maven"
name = project.name 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)