Skip to content

Commit 60ad0cf

Browse files
committed
Merge and work on RefCount
2 parents d3d2757 + 128e598 commit 60ad0cf

File tree

163 files changed

+13637
-7289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+13637
-7289
lines changed

CHANGES.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,119 @@
11
# RxJava Releases #
22

3+
### Version 0.12.2 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.12.2%22)) ###
4+
5+
* [Pull 352](https://github.com/Netflix/RxJava/pull/352) Groovy Language Adaptor: Add Func5-9 and N to the wrapper
6+
7+
### Version 0.12.1 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.12.1%22)) ###
8+
9+
* [Pull 350](https://github.com/Netflix/RxJava/pull/350) Swing module enhancements
10+
* [Pull 351](https://github.com/Netflix/RxJava/pull/351) Fix Observable.window static/instance bug
11+
12+
### Version 0.12.0 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.12.0%22)) ###
13+
14+
This version adds to the static typing changes in 0.11 and adds covariant/contravariant typing via super/extends generics.
15+
16+
Additional cleanup was done, particularly related to `BlockingObservable`. Also the `window` operator was added.
17+
18+
The largest breaking change is that `Observable.create` now accepts an `OnSubscribeFunc` rather than a `Func1`.
19+
20+
This means that instead of this:
21+
22+
```java
23+
public static <T> Observable<T> create(Func1<? super Observer<? super T>, ? extends Subscription> func)
24+
```
25+
26+
it is now:
27+
28+
```java
29+
public static <T> Observable<T> create(OnSubscribeFunc<T> func)
30+
```
31+
32+
This was done to simplify the usage of `Observable.create` which was already verbose but made far worse by the `? super` generics.
33+
34+
For example, instead of writing this:
35+
36+
```java
37+
Observable.create(new Func1<Observer<? super SomeType>, Subscription>() {
38+
/// body here
39+
}
40+
```
41+
42+
it is now written as:
43+
44+
```java
45+
Observable.create(new OnSubscribeFunc<SomeType>() {
46+
/// body here
47+
}
48+
```
49+
50+
* [Pull 343](https://github.com/Netflix/RxJava/pull/343) Covariant Support with super/extends and `OnSubscribeFunc` as type for `Observable.create`
51+
* [Pull 337](https://github.com/Netflix/RxJava/pull/337) Operator: `window`
52+
* [Pull 348](https://github.com/Netflix/RxJava/pull/348) Rename `switchDo` to `switchOnNext` (deprecate `switchDo` for eventual deletion)
53+
* [Pull 348](https://github.com/Netflix/RxJava/pull/348) Delete `switchDo` instance method in preference for static
54+
* [Pull 346](https://github.com/Netflix/RxJava/pull/346) Remove duplicate static methods from `BlockingObservable`
55+
* [Pull 346](https://github.com/Netflix/RxJava/pull/346) `BlockingObservable` no longer extends from `Observable`
56+
* [Pull 345](https://github.com/Netflix/RxJava/pull/345) Remove unnecessary constructor from `Observable`
57+
58+
### Version 0.11.2 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.11.2%22)) ###
59+
60+
* [Commit ccf53e8]( https://github.com/Netflix/RxJava/commit/ccf53e84835d99136cce80a4c508bae787d5da45) Update to Scala 2.10.2
61+
62+
### Version 0.11.1 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.11.1%22)) ###
63+
64+
* [Pull 325](https://github.com/Netflix/RxJava/pull/325) Clojure: Preserve metadata on fn and action macros
65+
66+
### Version 0.11.0 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.11.0%22)) ###
67+
68+
This is a major refactor of rxjava-core and the language adaptors.
69+
70+
Note that there are *breaking changes* in this release. Details are below.
71+
72+
After this refactor it is expected that the API will settle down and allow us to stabilize towards a 1.0 release.
73+
74+
* [Pull 332](https://github.com/Netflix/RxJava/pull/332) Refactor Core to be Statically Typed
75+
76+
RxJava was written from the beginning to target the JVM, not any specific language.
77+
78+
As a side-effect of Java not having lambdas/clojures yet (and other considerations), Netflix used dynamic languages with it predominantly for the year of its existence prior to open sourcing.
79+
80+
To bridge the rxjava-core written in Java with the various languages a FunctionalLanguageAdaptor was registered at runtime for each language of interest.
81+
82+
To enable these language adaptors methods are overloaded with `Object` in the API since `Object` is the only super-type that works across all languages for their various implementations of lambdas and closures.
83+
84+
This downside of this has been that it breaks static typing for Java, Scala and other statically-typed languages. More can be read on this issue and discussion of the subject here: https://groups.google.com/forum/#!topic/rxjava/bVZoKSsb1-o
85+
86+
This release:
87+
88+
- removes all `Object` overload methods from rxjava-core so it is statically typed
89+
- removes dynamic FunctionalLanguageAdaptors
90+
- uses idiomatic approaches for each language adaptor
91+
- Java core is statically typed and has no knowledge of other languages
92+
- Scala uses implicits
93+
- Groovy uses an ExtensionModule
94+
- Clojure adds a new macro ([NOTE: this requires code changes](https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-clojure#basic-usage))
95+
- JRuby has been temporarily disabled (discussing new implementation at https://github.com/Netflix/RxJava/issues/320)
96+
- language supports continue to be additive
97+
- the rxjava-core will always be required and then whichever language modules are desired such as rxjava-scala, rxjava-clojure, rxjava-groovy are added to the classpath
98+
- deletes deprecated methods
99+
- deletes redundant static methods on `Observable` that cluttered the API and in some cases caused dynamic languages trouble choosing which method to invoke
100+
- deletes redundant methods on `Scheduler` that gave dynamic languages a hard time choosing which method to invoke
101+
102+
The benefits of this are:
103+
104+
1) Everything is statically typed so compile-time checks for Java, Scala, etc work correctly
105+
2) Method dispatch is now done via native Java bytecode using types rather than going via `Object` which then has to do a lookup in a map. Memoization helped with the performance but each method invocation still required looking in a map for the correct adaptor. With this approach the appropriate methods will be compiled into the `rx.Observable` class to correctly invoke the right adaptor without lookups.
106+
3) Interaction from each language should work as expected idiomatically for that language.
107+
108+
Further history on the various discussions and different attempts at solutions can be seen at https://github.com/Netflix/RxJava/pull/304, https://github.com/Netflix/RxJava/issues/204 and https://github.com/Netflix/RxJava/issues/208
109+
110+
111+
### Version 0.10.1 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.10.1%22)) ###
112+
113+
A new contrib module for Android: https://github.com/Netflix/RxJava/tree/master/rxjava-contrib/rxjava-android
114+
115+
* [Pull 318](https://github.com/Netflix/RxJava/pull/318) rxjava-android module with Android Schedulers
116+
3117
### Version 0.10.0 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.10.0%22)) ###
4118

5119
This release includes a breaking change as it changes `onError(Exception)` to `onError(Throwable)`. This decision was made via discussion at https://github.com/Netflix/RxJava/issues/296.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ Some of the goals of RxJava are:
99
- Target the JVM not a language. The first languages supported (beyond Java itself) are
1010
<a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-groovy">Groovy</a>,
1111
<a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-clojure">Clojure</a>,
12-
<a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-scala">Scala</a>
13-
and <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-jruby">JRuby</a>.
12+
and <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-scala">Scala</a>.
1413
New language adapters can be <a href="https://github.com/Netflix/RxJava/wiki/How-to-Contribute">contributed</a>.
15-
- Support Java 5 (to include Android support) and higher with an eventual goal to target a build for Java 8 with its lambda support.
14+
- Support Java 6+ (to include Android support)
1615

1716
Learn more about Rx on the <a href="https://github.com/Netflix/RxJava/wiki">Wiki Home</a> and the <a href="http://techblog.netflix.com/2013/02/rxjava-netflix-api.html">Netflix TechBlog post</a> where RxJava was introduced.
1817

@@ -53,7 +52,6 @@ Once we hit 1.0 it will follow the normal major.minor.patch semantic versioning
5352
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-groovy">Groovy Adaptor</a>
5453
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-clojure">Clojure Adaptor</a>
5554
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-scala">Scala Adaptor</a>
56-
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-jruby">JRuby Adaptor</a>
5755

5856
## Binaries
5957

build.gradle

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,73 @@
1-
ext.githubProjectName = rootProject.name
1+
ext.githubProjectName = 'RxJava'
2+
3+
apply from: file('gradle/convention.gradle')
4+
apply from: file('gradle/maven.gradle')
5+
//apply from: file('gradle/check.gradle')
6+
apply from: file('gradle/license.gradle')
7+
apply from: file('gradle/release.gradle')
28

39
buildscript {
4-
repositories { mavenCentral() }
10+
repositories {
11+
mavenLocal()
12+
mavenCentral() // maven { url 'http://jcenter.bintray.com' }
13+
}
514
apply from: file('gradle/buildscript.gradle'), to: buildscript
615
}
716

817
allprojects {
9-
repositories { mavenCentral() }
18+
repositories {
19+
mavenLocal()
20+
mavenCentral() // maven { url: 'http://jcenter.bintray.com' }
21+
}
1022
}
1123

12-
apply from: file('gradle/convention.gradle')
13-
apply from: file('gradle/maven.gradle')
14-
//apply from: file('gradle/check.gradle')
15-
apply from: file('gradle/license.gradle')
16-
apply from: file('gradle/release.gradle')
17-
1824
subprojects {
25+
apply plugin: 'java'
26+
apply plugin: 'eclipse'
27+
apply plugin: 'idea'
1928

20-
group = "com.netflix.${githubProjectName}"
29+
group = "com.netflix.rxjava"
30+
31+
// make 'examples' use the same classpath
32+
configurations {
33+
examplesCompile.extendsFrom compile
34+
examplesRuntime.extendsFrom runtime
35+
}
2136

2237
sourceSets.test.java.srcDir 'src/main/java'
2338

2439
tasks.withType(Javadoc).each {
2540
it.classpath = sourceSets.main.compileClasspath
2641
}
42+
43+
//include /src/examples folder
44+
sourceSets {
45+
examples
46+
}
47+
48+
//include 'examples' in build task
49+
tasks.build {
50+
dependsOn(examplesClasses)
51+
}
52+
53+
eclipse {
54+
classpath {
55+
// include 'provided' dependencies on the classpath
56+
plusConfigurations += configurations.provided
57+
58+
downloadSources = true
59+
downloadJavadoc = true
60+
}
61+
}
62+
63+
idea {
64+
module {
65+
// include 'provided' dependencies on the classpath
66+
scopes.PROVIDED.plus += configurations.provided
67+
}
68+
}
2769
}
2870

71+
project(':rxjava-core') {
72+
sourceSets.test.java.srcDir 'src/test/java'
73+
}

codequality/checkstyle.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
<!-- Checks for common coding problems -->
129129
<!-- See http://checkstyle.sf.net/config_coding.html -->
130130
<!-- <module name="AvoidInlineConditionals"/> -->
131-
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
132131
<module name="EmptyStatement"/>
133132
<module name="EqualsHashCode"/>
134133
<module name="HiddenField">

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.10.1-SNAPSHOT
1+
version=0.12.3-SNAPSHOT

gradle/buildscript.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// Executed in context of buildscript
22
repositories {
33
// Repo in addition to maven central
4-
maven {
5-
name 'build-repo'
6-
url 'https://raw.github.com/Netflix-Skunkworks/build-repo/master/releases/' // gradle-release/gradle-release/1.0-SNAPSHOT/gradle-release-1.0-SNAPSHOT.jar
7-
}
4+
repositories { maven { url 'http://dl.bintray.com/content/netflixoss/external-gradle-plugins/' } } // For gradle-release
85
}
96
dependencies {
10-
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0'
7+
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.1'
118
classpath 'com.mapvine:gradle-cobertura-plugin:0.1'
12-
classpath 'gradle-release:gradle-release:1.0-SNAPSHOT'
9+
classpath 'gradle-release:gradle-release:1.1.5'
10+
classpath 'org.ajoberstar:gradle-git:0.5.0'
1311
}

gradle/check.gradle

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
subprojects {
2-
// Checkstyle
3-
apply plugin: 'checkstyle'
4-
tasks.withType(Checkstyle) { ignoreFailures = true }
5-
checkstyle {
6-
ignoreFailures = true // Waiting on GRADLE-2163
7-
configFile = rootProject.file('codequality/checkstyle.xml')
8-
}
2+
// Checkstyle
3+
apply plugin: 'checkstyle'
4+
checkstyle {
5+
ignoreFailures = true
6+
configFile = rootProject.file('codequality/checkstyle.xml')
7+
}
98

10-
// FindBugs
11-
apply plugin: 'findbugs'
12-
//tasks.withType(Findbugs) { reports.html.enabled true }
9+
// FindBugs
10+
apply plugin: 'findbugs'
11+
findbugs {
12+
ignoreFailures = true
13+
}
1314

14-
// PMD
15-
apply plugin: 'pmd'
16-
//tasks.withType(Pmd) { reports.html.enabled true }
15+
// PMD
16+
apply plugin: 'pmd'
17+
//tasks.withType(Pmd) { reports.html.enabled true }
1718

18-
apply plugin: 'cobertura'
19-
cobertura {
20-
sourceDirs = sourceSets.main.java.srcDirs
21-
format = 'html'
22-
includes = ['**/*.java', '**/*.groovy']
23-
excludes = []
24-
}
19+
apply plugin: 'cobertura'
20+
cobertura {
21+
sourceDirs = sourceSets.main.java.srcDirs
22+
format = 'html'
23+
includes = ['**/*.java', '**/*.groovy']
24+
excludes = []
25+
}
2526
}

gradle/convention.gradle

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
2-
// For Artifactory
3-
rootProject.status = version.contains('-SNAPSHOT')?'snapshot':'release'
1+
// GRADLE-2087 workaround, perform after java plugin
2+
status = project.hasProperty('preferredStatus')?project.preferredStatus:(version.contains('SNAPSHOT')?'snapshot':'release')
43

54
subprojects { project ->
65
apply plugin: 'java' // Plugin as major conventions
76

8-
version = rootProject.version
9-
107
sourceCompatibility = 1.6
118

12-
// GRADLE-2087 workaround, perform after java plugin
9+
// Restore status after Java plugin
1310
status = rootProject.status
1411

1512
task sourcesJar(type: Jar, dependsOn:classes) {
@@ -51,9 +48,6 @@ subprojects { project ->
5148
}
5249
}
5350

54-
// Ensure output is on a new line
55-
javadoc.doFirst { println "" }
56-
5751
configurations {
5852
provided {
5953
description = 'much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive.'
@@ -70,14 +64,38 @@ subprojects { project ->
7064
}
7165
}
7266

73-
task aggregateJavadoc(type: Javadoc) {
74-
description = 'Aggregate all subproject docs into a single docs directory'
75-
source subprojects.collect {project -> project.sourceSets.main.allJava }
76-
classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath})
77-
destinationDir = new File(projectDir, 'doc')
67+
apply plugin: 'github-pages' // Used to create publishGhPages task
68+
69+
def docTasks = [:]
70+
[Javadoc,ScalaDoc,Groovydoc].each{ Class docClass ->
71+
def allSources = allprojects.tasks*.withType(docClass).flatten()*.source
72+
if (allSources) {
73+
def shortName = docClass.simpleName.toLowerCase()
74+
def docTask = task "aggregate${shortName.capitalize()}"(type: docClass, description: "Aggregate subproject ${shortName}s") {
75+
source = allSources
76+
destinationDir = file("${project.buildDir}/docs/${shortName}")
77+
doFirst {
78+
def classpaths = allprojects.findAll { it.plugins.hasPlugin(JavaPlugin) }.collect { it.sourceSets.main.compileClasspath }
79+
classpath = files(classpaths)
80+
}
81+
}
82+
docTasks[shortName] = docTask
83+
processGhPages.dependsOn(docTask)
84+
}
85+
}
86+
87+
githubPages {
88+
repoUri = "[email protected]:Netflix/${rootProject.githubProjectName}.git"
89+
pages {
90+
docTasks.each { shortName, docTask ->
91+
from(docTask.outputs.files) {
92+
into "docs/${shortName}"
93+
}
94+
}
95+
}
7896
}
7997

8098
// Generate wrapper, which is distributed as part of source to alleviate the need of installing gradle
8199
task createWrapper(type: Wrapper) {
82-
gradleVersion = '1.1'
100+
gradleVersion = '1.6'
83101
}

gradle/license.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ apply plugin: 'license' //nl.javadude.gradle.plugins.license.LicensePlugin
55
license {
66
header rootProject.file('codequality/HEADER')
77
ext.year = Calendar.getInstance().get(Calendar.YEAR)
8+
skipExistingHeaders true
89
}
910
}

0 commit comments

Comments
 (0)