Skip to content

Commit 50f284a

Browse files
author
Szczepan Faber
committed
Working on Shipkit integration
1 parent 867e386 commit 50f284a

File tree

8 files changed

+94
-102
lines changed

8 files changed

+94
-102
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.gradle
22
build/
33
out/
4+
repo
45

56
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
67
!gradle-wrapper.jar

build.gradle

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
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.11.1"
9-
}
1+
plugins {
2+
id "org.shipkit.shipkit-auto-version" version "1.1.1"
3+
id "org.shipkit.shipkit-changelog" version "1.1.1"
4+
id "org.shipkit.shipkit-github-release" version "1.1.1"
105
}
116

12-
plugins {
13-
id 'com.github.ben-manes.versions' version '0.20.0'
7+
//TODO: update the group to 'org.mockito'
8+
group = 'com.nhaarman.mockito-kotlin2'
9+
10+
tasks.named("generateChangelog") {
11+
previousRevision = project.ext.'shipkit-auto-version.previous-tag'
12+
githubToken = System.getenv("GITHUB_TOKEN")
13+
repository = "mockito/mockito-kotlin"
1414
}
1515

16-
apply from: 'gradle/scripts/tagging.gradle'
16+
tasks.named("githubRelease") {
17+
def genTask = tasks.named("generateChangelog").get()
18+
dependsOn genTask
19+
repository = genTask.repository
20+
changelog = genTask.outputFile
21+
githubToken = System.getenv("GITHUB_TOKEN")
22+
newTagRevision = System.getenv("GITHUB_SHA")
23+
}
1724

18-
println ext.versionName

gradle/publishing.gradle

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
apply plugin: 'maven-publish'
2+
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')
15+
16+
task javadocJar(type: Jar, dependsOn: javadoc) {
17+
classifier = 'javadoc'
18+
from 'build/javadoc'
19+
}
20+
21+
task sourceJar(type: Jar) {
22+
from sourceSets.main.allSource
23+
}
24+
25+
publishing {
26+
publications {
27+
mavenJava(MavenPublication) {
28+
artifactId 'mockito-kotlin'
29+
30+
from components.java
31+
32+
artifact sourceJar {
33+
classifier "sources"
34+
}
35+
36+
artifact javadocJar
37+
38+
pom.withXml {
39+
def root = asNode()
40+
root.appendNode('name', 'Mockito-Kotlin')
41+
root.appendNode('description', 'Using Mockito with Kotlin.')
42+
root.appendNode('url', 'https://github.com/mockito/mockito-kotlin')
43+
44+
def scm = root.appendNode('scm')
45+
scm.appendNode('url', 'scm:git@github.com:mockito/mockito-kotlin.git')
46+
47+
def licenses = root.appendNode('licenses')
48+
def mitLicense = licenses.appendNode('license')
49+
mitLicense.appendNode('name', 'MIT')
50+
51+
def developers = root.appendNode('developers')
52+
def nhaarman = developers.appendNode('developer')
53+
nhaarman.appendNode('id', 'nhaarman')
54+
nhaarman.appendNode('name', 'Niek Haarman')
55+
}
56+
}
57+
}
58+
59+
//useful for testing - running "publish" will create artifacts/pom in a local dir
60+
repositories { maven { url = "$rootProject.buildDir/repo" } }
61+
}
62+
63+
// Avoid generation of the module metadata so that we don't have to publish an additional file
64+
// and keep the build logic simple.
65+
tasks.withType(GenerateModuleMetadata) {
66+
enabled = false
67+
}

gradle/scripts/tagging.gradle

Lines changed: 0 additions & 22 deletions
This file was deleted.

mockito-kotlin/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apply plugin: 'kotlin'
2-
apply from: '../publishing.gradle'
2+
apply from: '../gradle/publishing.gradle'
33
apply plugin: 'org.jetbrains.dokka'
44

55
buildscript {
@@ -13,8 +13,8 @@ buildscript {
1313
dependencies {
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
16-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
17-
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
16+
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5"
17+
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1" //TODO do we need android-maven-gradle-plugin?
1818
}
1919
}
2020

publishing.gradle

Lines changed: 0 additions & 63 deletions
This file was deleted.

tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repositories {
1818
}
1919

2020
dependencies {
21-
compile files("${rootProject.projectDir}/mockito-kotlin/build/libs/mockito-kotlin-${rootProject.ext.versionName}.jar")
21+
compile files("${rootProject.projectDir}/mockito-kotlin/build/libs/mockito-kotlin-${version}.jar")
2222

2323
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2424
compile "org.mockito:mockito-core:2.23.0"

version.properties

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

0 commit comments

Comments
 (0)