Skip to content

Commit dc4ab0a

Browse files
committed
Update publishing
1 parent a734cde commit dc4ab0a

File tree

2 files changed

+40
-17
lines changed

2 files changed

+40
-17
lines changed

mockito-kotlin/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ buildscript {
1414
dependencies {
1515
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1616
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.9"
17+
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
18+
classpath "com.github.dcendents:android-maven-gradle-plugin:1.5"
1719
}
1820
}
1921

mockito-kotlin/publishing.gradle

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
apply plugin: 'maven'
21
apply plugin: 'signing'
2+
apply plugin: 'com.jfrog.bintray'
3+
apply plugin: 'com.github.dcendents.android-maven'
34

45
group = 'com.nhaarman'
56
version = rootProject.ext.versionName
6-
def sonatypeUsername = hasProperty('sonatype_username') ? sonatype_username : System.getenv('SONATYPE_USERNAME')
7-
def sonatypePassword = hasProperty('sonatype_password') ? sonatype_password : System.getenv('SONATYPE_PASSWORD')
8-
97

108
task javadocJar(type: Jar, dependsOn: javadoc) {
119
classifier = 'javadoc'
@@ -28,19 +26,10 @@ signing {
2826
sign configurations.archives
2927
}
3028

31-
uploadArchives {
32-
repositories {
33-
mavenDeployer {
34-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
35-
36-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
37-
authentication(
38-
userName: sonatypeUsername,
39-
password: sonatypePassword
40-
)
41-
}
42-
43-
pom.project {
29+
install {
30+
repositories.mavenInstaller {
31+
pom {
32+
project {
4433
name 'Mockito-Kotlin'
4534
packaging 'jar'
4635
description 'Using Mockito with Kotlin.'
@@ -55,6 +44,7 @@ uploadArchives {
5544
licenses {
5645
license {
5746
name 'MIT'
47+
url 'https://opensource.org/licenses/MIT'
5848
distribution 'repo'
5949
}
6050
}
@@ -68,4 +58,35 @@ uploadArchives {
6858
}
6959
}
7060
}
61+
}
62+
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'
76+
77+
version {
78+
name = versionName
79+
80+
gpg {
81+
sign = true
82+
}
83+
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'
89+
}
90+
}
91+
}
7192
}

0 commit comments

Comments
 (0)