Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxJava3 update #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ version: 2
jobs:
build:
docker:
- image: circleci/android:api-28-alpha
- image: circleci/android:api-29@sha256:92328e25353eb1e6fb542ffd9a32aee5cdc5309e1732458e2c47e87538a40048
environment:
JVM_OPTS: -Xmx3200m
TZ: "/usr/share/zoneinfo/Asia/Seoul"
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "dependencies.gradle" }}
- run:
name: Install Build tools 28.0.0
command: sdkmanager "build-tools;28.0.0"
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
Expand Down
14 changes: 7 additions & 7 deletions coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ subprojects {
group = "Reporting"
description = "Generate Jacoco coverage report"

sourceDirectories = files(["${projectDir}/src/main/java"])
classDirectories = fileTree(
sourceDirectories.from = files(["${projectDir}/src/main/java"])
classDirectories.from = fileTree(
dir: "${buildDir}/intermediates/classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'com/android/**/*.class'])
executionData = files("${buildDir}/jacoco/testDebugUnitTest.exec")
executionData.from = files("${buildDir}/jacoco/testDebugUnitTest.exec")

reports {
xml.enabled = true
Expand Down Expand Up @@ -62,9 +62,9 @@ task mergeCoverageReports(type: JacocoReport) {
}
}

sourceDirectories = files(sources as String[])
classDirectories = classDirs
executionData = files(executions as String[])
sourceDirectories.from = files(sources as String[])
classDirectories.from = classDirs
executionData.from = files(executions as String[])

reports {
xml {
Expand All @@ -82,4 +82,4 @@ task mergeCoverageReports(type: JacocoReport) {
subprojects*.coverageReport
}
}
}
}
16 changes: 8 additions & 8 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
ext {
// Libraries

autoValueVersion = '1.5'
autoValueVersion = '1.5.3'
assertjVersion = '1.2.0'
firebaseAuthVersion = '16.1.0'
firebaseCoreVersion = '16.0.5'
firebaseDatabaseVersion = '16.0.3'
firebaseFirestoreVersion = '17.1.5'
firebaseStorageVersion = '16.0.1'
junitVersion = '4.12'
kotlinVersion = '1.2.61'
mockitoVersion = "2.13.0"
junitVersion = '4.13'
kotlinVersion = '1.4.20'
mockitoVersion = "3.0.0"
mockitoKotlinVersion = "1.5.0"
rxJavaVersion = '2.1.8'
rxJavaVersion = '3.0.8'

// Build plugins

androidPluginVersion = '3.2.1'
versionMatcherPluginVersion = '1.0.3'
androidPluginVersion = '4.1.1'
versionMatcherPluginVersion = '1.2.2'

// Build SDK versions
minSdkVersion = 14
compileSdkVersion = 28
compileSdkVersion = 29

// CI

Expand Down
6 changes: 3 additions & 3 deletions firebase-auth-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

dexOptions {
Expand Down Expand Up @@ -38,7 +38,7 @@ dependencies {
implementation project(':firebase-auth')

compileOnly "com.google.firebase:firebase-auth:${firebaseAuthVersion}"
compileOnly "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"
compileOnly "io.reactivex.rxjava3:rxjava:${rxJavaVersion}"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
}

Expand Down
2 changes: 1 addition & 1 deletion firebase-auth-kotlin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.androidhuman.rxfirebase2.auth.kotlin"/>
<manifest package="com.androidhuman.rxfirebase3.auth.kotlin" />
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@file:Suppress("NOTHING_TO_INLINE", "UNUSED")

package com.androidhuman.rxfirebase2.auth
package com.androidhuman.rxfirebase3.auth

import com.google.firebase.auth.AuthCredential
import com.google.firebase.auth.AuthResult
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import io.reactivex.Completable
import io.reactivex.Maybe
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Maybe
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Single

inline fun FirebaseAuth.authStateChanges()
: Observable<FirebaseAuth>
Expand Down Expand Up @@ -78,4 +78,4 @@ inline fun FirebaseAuth.rxUpdateCurrentUser(user: FirebaseUser)

inline fun FirebaseAuth.rxSignOut()
: Completable
= RxFirebaseAuth.signOut(this)
= RxFirebaseAuth.signOut(this)
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@file:Suppress("NOTHING_TO_INLINE", "UNUSED")

package com.androidhuman.rxfirebase2.auth
package com.androidhuman.rxfirebase3.auth

import com.google.firebase.auth.AuthCredential
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.PhoneAuthCredential
import com.google.firebase.auth.UserProfileChangeRequest
import io.reactivex.Completable
import io.reactivex.Single
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Single

inline fun FirebaseUser.rxDelete()
: Completable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@file:Suppress("NOTHING_TO_INLINE", "UNUSED")

package com.androidhuman.rxfirebase2.auth
package com.androidhuman.rxfirebase3.auth

import android.app.Activity
import com.google.firebase.auth.PhoneAuthProvider
import io.reactivex.Observable
import io.reactivex.rxjava3.core.Observable
import java.util.concurrent.Executor
import java.util.concurrent.TimeUnit

Expand Down
8 changes: 4 additions & 4 deletions firebase-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

dexOptions {
Expand Down Expand Up @@ -43,14 +43,14 @@ dependencies {

compileOnly "com.google.auto.value:auto-value:${autoValueVersion}"
compileOnly "com.google.firebase:firebase-auth:${firebaseAuthVersion}"
compileOnly "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"
compileOnly "io.reactivex.rxjava3:rxjava:${rxJavaVersion}"

annotationProcessor "com.google.auto.value:auto-value:${autoValueVersion}"

testImplementation "com.google.firebase:firebase-auth:${firebaseAuthVersion}"
testImplementation "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}"
testImplementation "junit:junit:${junitVersion}"
testImplementation "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"
testImplementation "io.reactivex.rxjava3:rxjava:${rxJavaVersion}"
testImplementation "org.assertj:assertj-core:${assertjVersion}"
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
Expand Down
2 changes: 1 addition & 1 deletion firebase-auth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.androidhuman.rxfirebase2.auth"/>
<manifest package="com.androidhuman.rxfirebase3.auth" />
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.firebase.auth.FirebaseAuth;

import com.androidhuman.rxfirebase2.core.SimpleDisposable;
import com.androidhuman.rxfirebase3.core.SimpleDisposable;

import android.support.annotation.NonNull;

import io.reactivex.Observable;
import io.reactivex.Observer;

import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Observer;

final class AuthStateChangesObserver extends Observable<FirebaseAuth> {

Expand All @@ -19,7 +18,7 @@ final class AuthStateChangesObserver extends Observable<FirebaseAuth> {
}

@Override
public void subscribeActual(Observer<? super FirebaseAuth> observer) {
public void subscribeActual(@NonNull Observer<? super FirebaseAuth> observer) {
Listener listener = new Listener(instance, observer);
observer.onSubscribe(listener);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;

import com.androidhuman.rxfirebase2.core.OnCompleteDisposable;
import com.androidhuman.rxfirebase3.core.OnCompleteDisposable;

import android.support.annotation.NonNull;

import io.reactivex.Single;
import io.reactivex.SingleObserver;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.core.SingleObserver;

class CreateUserWithEmailAndPasswordObserver extends Single<FirebaseUser> {

Expand All @@ -28,7 +28,7 @@ class CreateUserWithEmailAndPasswordObserver extends Single<FirebaseUser> {
}

@Override
public void subscribeActual(SingleObserver<? super FirebaseUser> observer) {
public void subscribeActual(@NonNull SingleObserver<? super FirebaseUser> observer) {
Listener listener = new Listener(observer);
observer.onSubscribe(listener);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.ProviderQueryResult;

import com.androidhuman.rxfirebase2.core.OnCompleteDisposable;
import com.androidhuman.rxfirebase3.core.OnCompleteDisposable;

import android.support.annotation.NonNull;

import java.util.List;

import io.reactivex.Maybe;
import io.reactivex.MaybeObserver;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.MaybeObserver;

@Deprecated
final class FetchProvidersForEmailObserver extends Maybe<List<String>> {
Expand All @@ -26,7 +26,7 @@ final class FetchProvidersForEmailObserver extends Maybe<List<String>> {
}

@Override
protected void subscribeActual(MaybeObserver<? super List<String>> observer) {
protected void subscribeActual(@NonNull MaybeObserver<? super List<String>> observer) {
Listener listener = new Listener(observer);
observer.onSubscribe(listener);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.SignInMethodQueryResult;

import com.androidhuman.rxfirebase2.core.OnCompleteDisposable;
import com.androidhuman.rxfirebase3.core.OnCompleteDisposable;

import android.support.annotation.NonNull;

import java.util.List;

import io.reactivex.Maybe;
import io.reactivex.MaybeObserver;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.MaybeObserver;

final class FetchSignInMethodsForEmailObserver extends Maybe<List<String>> {

Expand All @@ -26,7 +26,7 @@ final class FetchSignInMethodsForEmailObserver extends Maybe<List<String>> {
}

@Override
protected void subscribeActual(MaybeObserver<? super List<String>> observer) {
protected void subscribeActual(@NonNull MaybeObserver<? super List<String>> observer) {
Listener listener = new Listener(observer);
observer.onSubscribe(listener);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;

import io.reactivex.Maybe;
import io.reactivex.MaybeObserver;
import android.support.annotation.NonNull;

import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.MaybeObserver;

final class GetCurrentUserObserver extends Maybe<FirebaseUser> {

private FirebaseAuth instance;
private final FirebaseAuth instance;

GetCurrentUserObserver(FirebaseAuth instance) {
this.instance = instance;
}

@Override
protected void subscribeActual(MaybeObserver<? super FirebaseUser> observer) {
protected void subscribeActual(@NonNull MaybeObserver<? super FirebaseUser> observer) {
FirebaseUser user = instance.getCurrentUser();
if (null != user) {
observer.onSuccess(user);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.firebase.auth.PhoneAuthProvider;

import java.util.concurrent.atomic.AtomicBoolean;

import io.reactivex.disposables.Disposable;
import io.reactivex.rxjava3.disposables.Disposable;

abstract class OnVerificationStateChangedDisposable
extends PhoneAuthProvider.OnVerificationStateChangedCallbacks implements Disposable {

private AtomicBoolean unsubscribed = new AtomicBoolean();
private final AtomicBoolean unsubscribed = new AtomicBoolean();

@Override
public boolean isDisposed() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.auto.value.AutoValue;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

import com.google.auto.value.AutoValue;
import com.google.firebase.auth.PhoneAuthProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.androidhuman.rxfirebase2.auth;
package com.androidhuman.rxfirebase3.auth;

public abstract class PhoneAuthEvent {

Expand Down
Loading