Skip to content

Commit 92df626

Browse files
authored
Merge pull request #218 from ReactiveX/2.x-migr
Update Kotlin, RxJava and Gradle
2 parents 1a5baf8 + c6c1133 commit 92df626

10 files changed

+292
-136
lines changed

build.gradle

-40
This file was deleted.

build.gradle.kts

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
@file:Suppress("UNUSED_VARIABLE", "HasPlatformType")
2+
3+
import org.gradle.api.publish.maven.MavenPom
4+
import org.jetbrains.dokka.gradle.DokkaTask
5+
6+
buildscript {
7+
repositories {
8+
jcenter()
9+
}
10+
}
11+
12+
plugins {
13+
id("java-library")
14+
kotlin("jvm") version "1.3.40"
15+
id("org.jetbrains.dokka") version "0.9.18"
16+
id("maven-publish")
17+
id("com.jfrog.bintray") version "1.8.4"
18+
}
19+
20+
repositories {
21+
jcenter()
22+
}
23+
24+
group = "io.reactivex.rxjava2"
25+
26+
//additional source sets
27+
sourceSets {
28+
val examples by creating {
29+
java {
30+
compileClasspath += sourceSets.main.get().output
31+
runtimeClasspath += sourceSets.main.get().output
32+
}
33+
}
34+
}
35+
36+
//examples configuration
37+
val examplesImplementation by configurations.getting {
38+
extendsFrom(configurations.implementation.get())
39+
}
40+
41+
dependencies {
42+
implementation("io.reactivex.rxjava2:rxjava:2.2.10")
43+
implementation(kotlin("stdlib"))
44+
45+
testImplementation("org.funktionale:funktionale-partials:1.0.0-final")
46+
testImplementation("junit:junit:4.12")
47+
testImplementation("org.mockito:mockito-core:1.10.19")
48+
49+
examplesImplementation("com.squareup.retrofit2:retrofit:2.6.0")
50+
examplesImplementation("com.squareup.retrofit2:adapter-rxjava2:2.6.0")
51+
examplesImplementation("com.squareup.retrofit2:converter-moshi:2.6.0")
52+
}
53+
54+
//sources
55+
val sourcesJar by tasks.creating(Jar::class) {
56+
from(sourceSets.main.get().allSource)
57+
archiveClassifier.set("sources")
58+
}
59+
60+
//documentation
61+
val dokka by tasks.getting(DokkaTask::class) {
62+
outputFormat = "html"
63+
outputDirectory = "$buildDir/javadoc"
64+
65+
}
66+
67+
//documentation
68+
val dokkaJavadoc by tasks.creating(DokkaTask::class) {
69+
outputFormat = "javadoc"
70+
outputDirectory = "$buildDir/javadoc"
71+
}
72+
73+
//documentation
74+
val javadocJar by tasks.creating(Jar::class) {
75+
dependsOn(dokkaJavadoc)
76+
archiveClassifier.set("javadoc")
77+
from("$buildDir/javadoc")
78+
}
79+
80+
//publications
81+
val snapshot = "snapshot"
82+
val release = "release"
83+
84+
publishing {
85+
86+
fun MavenPom.initPom() {
87+
name.set("RxKotlin")
88+
description.set("RxJava bindings for Kotlin")
89+
url.set("https://github.com/ReactiveX/RxKotlin")
90+
91+
licenses {
92+
license {
93+
name.set("The Apache License, Version 2.0")
94+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
95+
}
96+
}
97+
scm {
98+
url.set("https://github.com/ReactiveX/RxKotlin.git")
99+
}
100+
}
101+
102+
publications {
103+
create<MavenPublication>(snapshot) {
104+
artifactId = "rxkotlin"
105+
version = "${project.version}-SNAPSHOT"
106+
107+
from(components["java"])
108+
109+
pom.initPom()
110+
}
111+
create<MavenPublication>(release) {
112+
artifactId = "rxkotlin"
113+
version = "${project.version}"
114+
115+
from(components["java"])
116+
artifact(sourcesJar)
117+
artifact(javadocJar)
118+
119+
pom.initPom()
120+
}
121+
}
122+
}
123+
124+
bintray {
125+
user = project.findProperty("bintrayUser") as? String
126+
key = project.findProperty("bintrayKey") as? String
127+
128+
val isRelease = project.findProperty("release") == "true"
129+
130+
publish = isRelease
131+
override = false
132+
133+
setPublications(if (isRelease) release else snapshot)
134+
135+
// dryRun = true
136+
137+
with(pkg) {
138+
userOrg = "reactivex"
139+
repo = "RxJava"
140+
name = "RxKotlin"
141+
setLicenses("Apache-2.0")
142+
setLabels("reactivex", "rxjava", "rxkotlin")
143+
websiteUrl = "https://github.com/ReactiveX/RxKotlin"
144+
issueTrackerUrl = "https://github.com/ReactiveX/RxKotlin/issues"
145+
vcsUrl = "https://github.com/ReactiveX/RxKotlin.git"
146+
147+
with(version) {
148+
name = project.version.toString()
149+
vcsTag = project.version.toString()
150+
151+
with(gpg){
152+
sign = true
153+
}
154+
155+
with(mavenCentralSync) {
156+
sync = true
157+
user = project.findProperty("sonatypeUsername") as? String
158+
password = project.findProperty("sonatypePassword") as? String
159+
close = "1"
160+
}
161+
}
162+
}
163+
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=2.2.0
1+
version=2.4.0
22
org.gradle.jvmargs=-Xms256m -Xmx1024m -XX:MaxPermSize=256m

gradle/buildViaTravis.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33

44
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
55
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
6-
./gradlew -Prelease.useLastTag=true build
6+
./gradlew build
77
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
88
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
9-
./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build snapshot --stacktrace
9+
./gradlew build
10+
echo -e 'To publish snapshot version to your local maven repo, execute: ./gradlew clean build publishSnapshotPublicationToMavenLocal'
1011
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
1112
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
12-
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final --stacktrace
13+
./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" \
14+
-Prelease=true build bintrayUpload --stacktrace
1315
else
1416
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
15-
./gradlew -Prelease.useLastTag=true build
17+
./gradlew build
1618
fi

gradle/wrapper/gradle-wrapper.jar

1.38 KB
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sun Mar 05 07:47:21 SGT 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip

gradlew

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,16 +44,16 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"
3551

36-
warn ( ) {
52+
warn () {
3753
echo "$*"
3854
}
3955

40-
die ( ) {
56+
die () {
4157
echo
4258
echo "$*"
4359
echo
@@ -155,7 +171,7 @@ if $cygwin ; then
155171
fi
156172

157173
# Escape application args
158-
save ( ) {
174+
save () {
159175
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160176
echo " "
161177
}

0 commit comments

Comments
 (0)