mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 15:50:57 +03:00
Changed release process to bintray
This commit is contained in:
189
build.gradle
189
build.gradle
@@ -1,15 +1,19 @@
|
|||||||
|
import java.text.SimpleDateFormat
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "java"
|
id "java"
|
||||||
id "groovy"
|
id "groovy"
|
||||||
id "maven"
|
|
||||||
id "idea"
|
|
||||||
id "signing"
|
|
||||||
id "osgi"
|
id "osgi"
|
||||||
|
id "maven-publish"
|
||||||
id "org.ajoberstar.release-opinion" version "1.4.2"
|
id "org.ajoberstar.release-opinion" version "1.4.2"
|
||||||
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 'ru.vyarus.pom' version '1.0.3'
|
||||||
|
id 'ru.vyarus.github-info' version '1.1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.hierynomus"
|
group = "com.hierynomus"
|
||||||
|
defaultTasks "build"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -20,50 +24,6 @@ targetCompatibility = 1.6
|
|||||||
|
|
||||||
configurations.compile.transitive = false
|
configurations.compile.transitive = false
|
||||||
|
|
||||||
idea {
|
|
||||||
module {
|
|
||||||
downloadJavadoc = true
|
|
||||||
downloadSources = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
license {
|
|
||||||
mapping {
|
|
||||||
java = 'SLASHSTAR_STYLE'
|
|
||||||
}
|
|
||||||
header rootProject.file('LICENSE_HEADER')
|
|
||||||
strictCheck true
|
|
||||||
excludes(['**/djb/Curve25519.java', '**/sshj/common/Base64.java'])
|
|
||||||
}
|
|
||||||
|
|
||||||
release {
|
|
||||||
grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
test {
|
|
||||||
testLogging {
|
|
||||||
exceptionFormat = 'full'
|
|
||||||
}
|
|
||||||
include "**/*Test.*"
|
|
||||||
include "**/*Spec.*"
|
|
||||||
if (!project.hasProperty("allTests")) {
|
|
||||||
useJUnit {
|
|
||||||
excludeCategories 'com.hierynomus.sshj.test.SlowTests'
|
|
||||||
excludeCategories 'com.hierynomus.sshj.test.KnownFailingTests'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
afterSuite { descriptor, result ->
|
|
||||||
if (descriptor.className != null) {
|
|
||||||
def indicator = "\u001B[32m✓\u001b[0m"
|
|
||||||
if (result.failedTestCount > 0) {
|
|
||||||
indicator = "\u001B[31m✘\u001b[0m"
|
|
||||||
}
|
|
||||||
logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def bouncycastleVersion = "1.51"
|
def bouncycastleVersion = "1.51"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -84,6 +44,26 @@ dependencies {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
license {
|
||||||
|
header rootProject.file('LICENSE_HEADER')
|
||||||
|
strictCheck true
|
||||||
|
mapping {
|
||||||
|
java = 'SLASHSTAR_STYLE'
|
||||||
|
}
|
||||||
|
excludes(['**/djb/Curve25519.java', '**/sshj/common/Base64.java'])
|
||||||
|
}
|
||||||
|
|
||||||
|
release {
|
||||||
|
grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir)
|
||||||
|
}
|
||||||
|
|
||||||
|
// This disables the pedantic doclint feature of JDK8
|
||||||
|
if (JavaVersion.current().isJava8Compatible()) {
|
||||||
|
tasks.withType(Javadoc) {
|
||||||
|
options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
instruction "Bundle-Description", "SSHv2 library for Java"
|
instruction "Bundle-Description", "SSHv2 library for Java"
|
||||||
@@ -119,61 +99,41 @@ task sourcesJar(type: Jar) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
tasks.withType(Test) {
|
||||||
archives javadocJar, sourcesJar
|
testLogging {
|
||||||
}
|
exceptionFormat = 'full'
|
||||||
|
}
|
||||||
|
include "**/*Test.*"
|
||||||
|
include "**/*Spec.*"
|
||||||
|
if (!project.hasProperty("allTests")) {
|
||||||
|
useJUnit {
|
||||||
|
excludeCategories 'com.hierynomus.sshj.test.SlowTests'
|
||||||
|
excludeCategories 'com.hierynomus.sshj.test.KnownFailingTests'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
signing {
|
afterSuite { descriptor, result ->
|
||||||
required { !version.toString().contains("SNAPSHOT") && gradle.taskGraph.hasTask("uploadArchives") }
|
if (descriptor.className != null) {
|
||||||
sign configurations.archives
|
def indicator = "\u001B[32m✓\u001b[0m"
|
||||||
}
|
if (result.failedTestCount > 0) {
|
||||||
|
indicator = "\u001B[31m✘\u001b[0m"
|
||||||
// This disables the pedantic doclint feature of JDK8
|
}
|
||||||
if (JavaVersion.current().isJava8Compatible()) {
|
logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m")
|
||||||
tasks.withType(Javadoc) {
|
}
|
||||||
options.addStringOption('Xdoclint:none', '-quiet')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadArchives {
|
project.tasks.compileGroovy.onlyIf { false }
|
||||||
if (project.hasProperty('sonatypeUsername')) {
|
|
||||||
repositories.mavenDeployer {
|
|
||||||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
|
||||||
|
|
||||||
configuration = configurations.archives
|
github {
|
||||||
|
user 'hierynomus'
|
||||||
|
license 'Apache'
|
||||||
|
}
|
||||||
|
|
||||||
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
|
pom {
|
||||||
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
|
||||||
}
|
|
||||||
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
|
|
||||||
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
|
||||||
}
|
|
||||||
|
|
||||||
pom.project {
|
|
||||||
name "sshj"
|
|
||||||
description "SSHv2 library for Java"
|
description "SSHv2 library for Java"
|
||||||
url "https://github.com/hierynomus/sshj"
|
url "https://github.com/hierynomus/sshj"
|
||||||
inceptionYear "2009"
|
inceptionYear "2009"
|
||||||
|
|
||||||
issueManagement {
|
|
||||||
system "github"
|
|
||||||
url "https://github.com/hierynomus/sshj/issues"
|
|
||||||
}
|
|
||||||
|
|
||||||
scm {
|
|
||||||
connection "scm:git:git://github.com/hierynomus/sshj.git"
|
|
||||||
developerConnection "scm:git:git@github.com:hierynomus/sshj.git"
|
|
||||||
url "https://github.com/hierynomus/sshj.git"
|
|
||||||
}
|
|
||||||
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name "Apache 2"
|
|
||||||
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
|
|
||||||
distribution "repo"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
developer {
|
developer {
|
||||||
id "hierynomus"
|
id "hierynomus"
|
||||||
@@ -203,10 +163,49 @@ uploadArchives {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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"]
|
||||||
|
pkg {
|
||||||
|
repo = "maven"
|
||||||
|
name = project.name
|
||||||
|
licenses = ["Apache-2.0"]
|
||||||
|
vcsUrl = "https://github.com/hierynomus/sshj.git"
|
||||||
|
labels = ["ssh", "sftp", "secure-shell", "network", "file-transfer"]
|
||||||
|
githubRepo = "hierynomus/sshj"
|
||||||
|
version {
|
||||||
|
name = project.version.toString()
|
||||||
|
vcsTag = "v${project.version}"
|
||||||
|
released = new SimpleDateFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSSZZ').format(new Date())
|
||||||
|
gpg {
|
||||||
|
sign = true
|
||||||
|
passphrase = project.property("signing.password")
|
||||||
|
}
|
||||||
|
mavenCentralSync {
|
||||||
|
sync = true
|
||||||
|
user = project.property("sonatypeUsername")
|
||||||
|
password = project.property("sonatypePassword")
|
||||||
|
close = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.compileGroovy.onlyIf { false }
|
project.tasks.release.dependsOn([project.tasks.build, project.tasks.bintrayUpload])
|
||||||
tasks.release.dependsOn 'build', 'uploadArchives'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user