Skip to content

Commit 2de53c6

Browse files
committed
Use spring-bintray-plugin for publishing
1 parent 2731365 commit 2de53c6

File tree

3 files changed

+39
-77
lines changed

3 files changed

+39
-77
lines changed

RELEASING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
To publish a release:
22

33
- Tag the commit on master: `git tag -a x.x.x -m x.x.x && git push --tags`
4-
- Execute the release process: `./gradlew clean test uploadArchives -PisRelease=true`
5-
- Head to https://oss.sonatype.org/#stagingRepositories to close and release the deployment.
4+
- Execute the release process: `./gradlew clean test mavenCentralSync -PisRelease=true`
65
- Don't forget to publish the tag on Github with release notes :)

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
buildscript {
2+
repositories {
3+
maven {
4+
url "https://plugins.gradle.org/m2/"
5+
}
6+
}
7+
dependencies {
8+
classpath "io.spring.gradle:spring-bintray-plugin:0.9.0"
9+
}
10+
}
11+
112
plugins {
213
id 'com.github.ben-manes.versions' version '0.17.0'
314
}

publishing.gradle

Lines changed: 27 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,43 @@
1-
apply plugin: 'signing'
2-
apply plugin: 'com.jfrog.bintray'
3-
apply plugin: 'com.github.dcendents.android-maven'
1+
apply plugin: 'maven-publish'
2+
apply plugin: "io.spring.bintray"
43

5-
group = 'com.nhaarman'
6-
version = rootProject.ext.versionName
4+
bintray {
5+
bintrayUser = hasProperty('bintray_username') ? bintray_username : System.getenv('BINTRAY_USER')
6+
bintrayKey = hasProperty('bintray_key') ? bintray_key : System.getenv('BINTRAY_KEY')
7+
repo = 'maven'
8+
org = hasProperty('bintray_username') ? bintray_username : System.getenv('BINTRAY_USER')
9+
packageName = 'Mockito-Kotlin'
10+
publication = 'mavenJava'
11+
12+
licenses = ['MIT']
13+
ossrhUser = hasProperty('sonatype_username') ? sonatype_username : System.getenv('SONATYPE_USERNAME')
14+
ossrhPassword = hasProperty('sonatype_password') ? sonatype_password : System.getenv('SONATYPE_PASSWORD')
15+
overrideOnUpload = false
16+
}
17+
bintray.gpgPassphrase = hasProperty('signing_password') ? signing_password : System.getenv('SIGNING_PASSWORD')
718

819
task javadocJar(type: Jar, dependsOn: javadoc) {
920
classifier = 'javadoc'
1021
from 'build/javadoc'
1122
}
1223

13-
task sourcesJar(type: Jar) {
24+
task sourceJar(type: Jar) {
1425
from sourceSets.main.allSource
15-
classifier = 'sources'
16-
}
17-
18-
artifacts {
19-
archives jar
20-
21-
archives javadocJar
22-
archives sourcesJar
23-
}
24-
25-
signing {
26-
sign configurations.archives
27-
}
28-
29-
install {
30-
repositories.mavenInstaller {
31-
pom {
32-
project {
33-
name 'Mockito-Kotlin'
34-
packaging 'jar'
35-
description 'Using Mockito with Kotlin.'
36-
url 'https://github.com/nhaarman/mockito-kotlin'
37-
38-
scm {
39-
url 'scm:git@github.com:nhaarman/mockito-kotlin.git'
40-
connection 'scm:git@github.com:nhaarman/mockito-kotlin.git'
41-
developerConnection 'scm:git@github.com:nhaarman/mockito-kotlin.git'
42-
}
43-
44-
licenses {
45-
license {
46-
name 'MIT'
47-
url 'https://opensource.org/licenses/MIT'
48-
distribution 'repo'
49-
}
50-
}
51-
52-
developers {
53-
developer {
54-
id 'nhaarman'
55-
name 'Niek Haarman'
56-
}
57-
}
58-
}
59-
}
60-
}
6126
}
6227

63-
bintray {
64-
user = hasProperty('bintray_username') ? bintray_username : System.getenv('BINTRAY_USER')
65-
key = hasProperty('bintray_key') ? bintray_key : System.getenv('BINTRAY_KEY')
66-
67-
configurations = ['archives']
68-
69-
publish = true
70-
71-
pkg {
72-
repo = 'maven'
73-
name = 'Mockito-Kotlin'
74-
licenses = ['MIT']
75-
vcsUrl = 'https://github.com/nhaarman/mockito-kotlin.git'
28+
group = 'com.nhaarman'
29+
version = rootProject.ext.versionName
7630

77-
version {
78-
name = versionName
31+
publishing {
32+
publications {
33+
mavenJava(MavenPublication) {
34+
groupId 'com.nhaarman'
35+
artifactId 'mockito-kotlin'
7936

80-
gpg {
81-
sign = true
82-
}
37+
from components.java
8338

84-
mavenCentralSync {
85-
sync = true
86-
user = hasProperty('sonatype_username') ? sonatype_username : System.getenv('SONATYPE_USERNAME')
87-
password = hasProperty('sonatype_password') ? sonatype_password : System.getenv('SONATYPE_PASSWORD')
88-
close = '1'
39+
artifact sourceJar {
40+
classifier "sources"
8941
}
9042
}
9143
}

0 commit comments

Comments
 (0)