Skip to content

Commit 5624a10

Browse files
author
Szczepan Faber
committed
Enabled Bintray publications
Tested by: - building artifacts locally and recursively comparing with the previously released artifacts/poms - published to 'test' repo on Bintray
1 parent 50f284a commit 5624a10

File tree

3 files changed

+47
-16
lines changed

3 files changed

+47
-16
lines changed

build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ plugins {
44
id "org.shipkit.shipkit-github-release" version "1.1.1"
55
}
66

7-
//TODO: update the group to 'org.mockito'
8-
group = 'com.nhaarman.mockito-kotlin2'
9-
107
tasks.named("generateChangelog") {
118
previousRevision = project.ext.'shipkit-auto-version.previous-tag'
129
githubToken = System.getenv("GITHUB_TOKEN")

gradle/publishing.gradle

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
apply plugin: 'maven-publish'
22

3-
//bintray.bintrayUser = hasProperty('bintray_username') ? bintray_username : System.getenv('BINTRAY_USER')
4-
//bintray.bintrayKey = hasProperty('bintray_key') ? bintray_key : System.getenv('BINTRAY_KEY')
5-
//bintray.repo = 'maven'
6-
//bintray.org = hasProperty('bintray_username') ? bintray_username : System.getenv('BINTRAY_USER')
7-
//bintray.packageName = 'Mockito-Kotlin'
8-
//bintray.publication = 'mavenJava'
9-
//
10-
//bintray.licenses = ['MIT']
11-
//bintray.ossrhUser = hasProperty('sonatype_username') ? sonatype_username : System.getenv('SONATYPE_USERNAME')
12-
//bintray.ossrhPassword = hasProperty('sonatype_password') ? sonatype_password : System.getenv('SONATYPE_PASSWORD')
13-
//bintray.overrideOnUpload = false
14-
//bintray.gpgPassphrase = hasProperty('signing_password') ? signing_password : System.getenv('SIGNING_PASSWORD')
3+
//TODO: update the group to 'org.mockito' ***AND*** change java packages
4+
group = 'com.nhaarman.mockitokotlin2'
155

166
task javadocJar(type: Jar, dependsOn: javadoc) {
177
classifier = 'javadoc'
@@ -60,8 +50,52 @@ publishing {
6050
repositories { maven { url = "$rootProject.buildDir/repo" } }
6151
}
6252

53+
clean {
54+
delete "$rootProject.buildDir/repo"
55+
}
56+
6357
// Avoid generation of the module metadata so that we don't have to publish an additional file
6458
// and keep the build logic simple.
6559
tasks.withType(GenerateModuleMetadata) {
6660
enabled = false
61+
}
62+
63+
//fleshes out problems with Maven pom generation when building
64+
tasks.build.dependsOn('publishJavaLibraryPublicationToMavenLocal')
65+
66+
//Bintray Gradle plugin configuration (https://github.com/bintray/gradle-bintray-plugin)
67+
//Plugin jars are added to the buildscript classpath in the root build.gradle file
68+
apply plugin: 'com.jfrog.bintray'
69+
70+
bintray {
71+
//We need to use some user id here, because the Bintray key is associated with the user
72+
//However, any user id is good, so longer the user has necessary privileges to the repository
73+
user = 'szczepiq' //https://bintray.com/szczepiq
74+
key = System.getenv('BINTRAY_API_KEY')
75+
publish = false //can be changed to 'false' for testing
76+
dryRun = project.hasProperty('bintrayDryRun')
77+
78+
publications = ['mavenJava']
79+
80+
pkg {
81+
repo = 'test' //https://bintray.com/mockito/maven // TODO change to 'maaven' when CI ready
82+
userOrg = 'mockito' //https://bintray.com/mockito
83+
84+
name = 'mockito-kotlin'
85+
86+
licenses = ['MIT']
87+
labels = ['kotlin', 'mockito']
88+
vcsUrl = 'https://github.com/mockito/mockito-kotlin.git'
89+
90+
version {
91+
name = project.version
92+
vcsTag = "v$project.version"
93+
94+
mavenCentralSync {
95+
sync = false // TODO enable after CI+bintray integration is ready
96+
user = System.getenv('NEXUS_TOKEN_USER')
97+
password = System.getenv('NEXUS_TOKEN_PWD')
98+
}
99+
}
100+
}
67101
}

version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Version of the produced binaries.
22
# The version is inferred by shipkit-auto-version Gradle plugin (https://github.com/shipkit/shipkit-auto-version)
3-
version=2.2.1-SNAPSHOT
3+
version=2.3.0

0 commit comments

Comments
 (0)