-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #218 from ReactiveX/2.x-migr
Update Kotlin, RxJava and Gradle
- Loading branch information
Showing
10 changed files
with
292 additions
and
136 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
@file:Suppress("UNUSED_VARIABLE", "HasPlatformType") | ||
|
||
import org.gradle.api.publish.maven.MavenPom | ||
import org.jetbrains.dokka.gradle.DokkaTask | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
} | ||
|
||
plugins { | ||
id("java-library") | ||
kotlin("jvm") version "1.3.40" | ||
id("org.jetbrains.dokka") version "0.9.18" | ||
id("maven-publish") | ||
id("com.jfrog.bintray") version "1.8.4" | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
group = "io.reactivex.rxjava2" | ||
|
||
//additional source sets | ||
sourceSets { | ||
val examples by creating { | ||
java { | ||
compileClasspath += sourceSets.main.get().output | ||
runtimeClasspath += sourceSets.main.get().output | ||
} | ||
} | ||
} | ||
|
||
//examples configuration | ||
val examplesImplementation by configurations.getting { | ||
extendsFrom(configurations.implementation.get()) | ||
} | ||
|
||
dependencies { | ||
implementation("io.reactivex.rxjava2:rxjava:2.2.10") | ||
implementation(kotlin("stdlib")) | ||
|
||
testImplementation("org.funktionale:funktionale-partials:1.0.0-final") | ||
testImplementation("junit:junit:4.12") | ||
testImplementation("org.mockito:mockito-core:1.10.19") | ||
|
||
examplesImplementation("com.squareup.retrofit2:retrofit:2.6.0") | ||
examplesImplementation("com.squareup.retrofit2:adapter-rxjava2:2.6.0") | ||
examplesImplementation("com.squareup.retrofit2:converter-moshi:2.6.0") | ||
} | ||
|
||
//sources | ||
val sourcesJar by tasks.creating(Jar::class) { | ||
from(sourceSets.main.get().allSource) | ||
archiveClassifier.set("sources") | ||
} | ||
|
||
//documentation | ||
val dokka by tasks.getting(DokkaTask::class) { | ||
outputFormat = "html" | ||
outputDirectory = "$buildDir/javadoc" | ||
|
||
} | ||
|
||
//documentation | ||
val dokkaJavadoc by tasks.creating(DokkaTask::class) { | ||
outputFormat = "javadoc" | ||
outputDirectory = "$buildDir/javadoc" | ||
} | ||
|
||
//documentation | ||
val javadocJar by tasks.creating(Jar::class) { | ||
dependsOn(dokkaJavadoc) | ||
archiveClassifier.set("javadoc") | ||
from("$buildDir/javadoc") | ||
} | ||
|
||
//publications | ||
val snapshot = "snapshot" | ||
val release = "release" | ||
|
||
publishing { | ||
|
||
fun MavenPom.initPom() { | ||
name.set("RxKotlin") | ||
description.set("RxJava bindings for Kotlin") | ||
url.set("https://github.com/ReactiveX/RxKotlin") | ||
|
||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/ReactiveX/RxKotlin.git") | ||
} | ||
} | ||
|
||
publications { | ||
create<MavenPublication>(snapshot) { | ||
artifactId = "rxkotlin" | ||
version = "${project.version}-SNAPSHOT" | ||
|
||
from(components["java"]) | ||
|
||
pom.initPom() | ||
} | ||
create<MavenPublication>(release) { | ||
artifactId = "rxkotlin" | ||
version = "${project.version}" | ||
|
||
from(components["java"]) | ||
artifact(sourcesJar) | ||
artifact(javadocJar) | ||
|
||
pom.initPom() | ||
} | ||
} | ||
} | ||
|
||
bintray { | ||
user = project.findProperty("bintrayUser") as? String | ||
key = project.findProperty("bintrayKey") as? String | ||
|
||
val isRelease = project.findProperty("release") == "true" | ||
|
||
publish = isRelease | ||
override = false | ||
|
||
setPublications(if (isRelease) release else snapshot) | ||
|
||
// dryRun = true | ||
|
||
with(pkg) { | ||
userOrg = "reactivex" | ||
repo = "RxJava" | ||
name = "RxKotlin" | ||
setLicenses("Apache-2.0") | ||
setLabels("reactivex", "rxjava", "rxkotlin") | ||
websiteUrl = "https://github.com/ReactiveX/RxKotlin" | ||
issueTrackerUrl = "https://github.com/ReactiveX/RxKotlin/issues" | ||
vcsUrl = "https://github.com/ReactiveX/RxKotlin.git" | ||
|
||
with(version) { | ||
name = project.version.toString() | ||
vcsTag = project.version.toString() | ||
|
||
with(gpg){ | ||
sign = true | ||
} | ||
|
||
with(mavenCentralSync) { | ||
sync = true | ||
user = project.findProperty("sonatypeUsername") as? String | ||
password = project.findProperty("sonatypePassword") as? String | ||
close = "1" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version=2.2.0 | ||
version=2.4.0 | ||
org.gradle.jvmargs=-Xms256m -Xmx1024m -XX:MaxPermSize=256m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Sun Mar 05 07:47:21 SGT 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.