diff --git a/android/demos/memory-leaks/build.gradle b/android/demos/memory-leaks/build.gradle index 567281d7..c1d3d0c5 100644 --- a/android/demos/memory-leaks/build.gradle +++ b/android/demos/memory-leaks/build.gradle @@ -72,6 +72,7 @@ dependencies { compileOnly deps.apt.javax testImplementation project(":libraries:rib-test-utils") errorprone deps.build.errorProne + errorprone deps.build.guavaJre errorproneJavac deps.build.errorProneJavac errorprone deps.build.nullAway } diff --git a/android/gradle/dependencies.gradle b/android/gradle/dependencies.gradle index b8b7f40d..fd568199 100755 --- a/android/gradle/dependencies.gradle +++ b/android/gradle/dependencies.gradle @@ -51,7 +51,7 @@ def build = [ minSdkVersion: 16, targetSdkVersion: 28, javaVersion: JavaVersion.VERSION_1_8, - guava: "com.google.guava:guava:27.1-android", + guavaJre: "com.google.guava:guava:27.1-jre", commonsLang: "commons-lang:commons-lang:2.6", intellijPlugin: "gradle.plugin.org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.4.8", errorProne: "com.google.errorprone:error_prone_core:${versions.errorProne}", @@ -82,6 +82,7 @@ def test = [ def external = [ dagger: "com.google.dagger:dagger:${versions.dagger}", + guavaAndroid: "com.google.guava:guava:27.1-android", rxjava2: "io.reactivex.rxjava2:rxjava:2.2.8", rxrelay2: "com.jakewharton.rxrelay2:rxrelay:2.1.0", rxandroid2: "io.reactivex.rxjava2:rxandroid:2.1.1", diff --git a/android/libraries/rib-android-test/src/main/java/com/uber/rib/core/RibActivity.java b/android/libraries/rib-android-test/src/main/java/com/uber/rib/core/RibActivity.java index ab6d8242..9a66cfdb 100644 --- a/android/libraries/rib-android-test/src/main/java/com/uber/rib/core/RibActivity.java +++ b/android/libraries/rib-android-test/src/main/java/com/uber/rib/core/RibActivity.java @@ -19,6 +19,8 @@ import android.content.Intent; import androidx.annotation.CallSuper; import androidx.annotation.Nullable; import android.view.ViewGroup; + +import com.google.common.base.Preconditions; import com.jakewharton.rxrelay2.BehaviorRelay; import com.jakewharton.rxrelay2.PublishRelay; import com.jakewharton.rxrelay2.Relay; diff --git a/android/libraries/rib-android/build.gradle b/android/libraries/rib-android/build.gradle index 4c77bc15..cc01a1a7 100644 --- a/android/libraries/rib-android/build.gradle +++ b/android/libraries/rib-android/build.gradle @@ -44,6 +44,7 @@ dependencies { implementation deps.apt.javaxInject implementation deps.androidx.annotations implementation deps.androidx.appcompat + implementation deps.external.guavaAndroid } apply from: rootProject.file('gradle/gradle-mvn-push.gradle') diff --git a/android/libraries/rib-android/src/main/java/com/uber/rib/core/RibActivity.java b/android/libraries/rib-android/src/main/java/com/uber/rib/core/RibActivity.java index 9654778f..e423616f 100644 --- a/android/libraries/rib-android/src/main/java/com/uber/rib/core/RibActivity.java +++ b/android/libraries/rib-android/src/main/java/com/uber/rib/core/RibActivity.java @@ -19,6 +19,8 @@ import android.content.Intent; import androidx.annotation.CallSuper; import androidx.annotation.Nullable; import android.view.ViewGroup; + +import com.google.common.base.Preconditions; import com.jakewharton.rxrelay2.BehaviorRelay; import com.jakewharton.rxrelay2.PublishRelay; import com.jakewharton.rxrelay2.Relay; diff --git a/android/libraries/rib-base/build.gradle b/android/libraries/rib-base/build.gradle index 1123576c..8243ce40 100644 --- a/android/libraries/rib-base/build.gradle +++ b/android/libraries/rib-base/build.gradle @@ -31,7 +31,7 @@ dependencies { // in order to invert a dependency. With a bit of work this could be removed. annotationProcessor deps.apt.daggerCompiler - compile project(':libraries:rib-uava') + compile deps.external.guavaAndroid compile deps.external.reactiveStreams compile deps.external.rxrelay2 compile deps.external.rxjava2 diff --git a/android/libraries/rib-base/src/main/java/com/uber/rib/core/Router.java b/android/libraries/rib-base/src/main/java/com/uber/rib/core/Router.java index c2b354e2..cb8a406f 100644 --- a/android/libraries/rib-base/src/main/java/com/uber/rib/core/Router.java +++ b/android/libraries/rib-base/src/main/java/com/uber/rib/core/Router.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Locale; import java.util.concurrent.CopyOnWriteArrayList; -import static com.uber.rib.core.Preconditions.*; +import static com.google.common.base.Preconditions.*; /** * Responsible for handling the addition and removal of children routers. diff --git a/android/libraries/rib-uava/README.md b/android/libraries/rib-uava/README.md deleted file mode 100644 index a61b590f..00000000 --- a/android/libraries/rib-uava/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# rib-uava - -We don't want the base RIB libraries to have a dependency on Guava. But we do like the -`Optional`, `Absent` and `Preconditions` classes. So we include them here. diff --git a/android/libraries/rib-uava/build.gradle b/android/libraries/rib-uava/build.gradle deleted file mode 100644 index 5915b9f7..00000000 --- a/android/libraries/rib-uava/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2017. Uber Technologies - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: "java-library" - -sourceCompatibility = deps.build.javaVersion.toString() -targetCompatibility = deps.build.javaVersion.toString() - -dependencies { - compileOnly deps.androidx.annotations -} - -apply from: rootProject.file('gradle/gradle-mvn-push.gradle') diff --git a/android/libraries/rib-uava/gradle.properties b/android/libraries/rib-uava/gradle.properties deleted file mode 100755 index 70fc1e8f..00000000 --- a/android/libraries/rib-uava/gradle.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2017. Uber Technologies -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -POM_NAME=RIBs (Uava) -POM_ARTIFACT_ID=rib-uava -POM_PACKAGING=jar diff --git a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Absent.java b/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Absent.java deleted file mode 100644 index afd0fcf6..00000000 --- a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Absent.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2013 The Guava Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - - -package com.uber.rib.core; - -import androidx.annotation.Nullable; - -import java.util.function.Function; - -import static com.uber.rib.core.Preconditions.*; - -/** Implementation of an {@link Optional} not containing a reference. */ -final class Absent extends Optional { - - static final Absent INSTANCE = new Absent(); - - private Absent() {} - - @SuppressWarnings("unchecked") - static Optional withType() { - return (Optional) INSTANCE; - } - - @Override - public boolean isPresent() { - return false; - } - - @Override - public T get() { - throw new IllegalStateException("Optional.get() cannot be called on an absent value"); - } - - @Override - public T or(T defaultValue) { - return checkNotNull(defaultValue); - } - - @SuppressWarnings("unchecked") - @Override - public Optional or(Optional secondChoice) { - return (Optional) checkNotNull(secondChoice); - } - - @Override - @Nullable - public T orNull() { - return null; - } - - @Override - public Optional transform(Function function) { - checkNotNull(function); - return Optional.absent(); - } - - @Override - public boolean equals(Object object) { - return object == this; - } - - @Override - public int hashCode() { - return 0x598df91c; - } - - @Override - public String toString() { - return "Optional.absent()"; - } -} diff --git a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Optional.java b/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Optional.java deleted file mode 100644 index 737ac814..00000000 --- a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Optional.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2013 The Guava Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - - -package com.uber.rib.core; - -import androidx.annotation.Nullable; - -import java.util.function.Function; - -import static com.uber.rib.core.Preconditions.checkNotNull; - -/** - * An immutable object that may contain a non-null reference to another object. Each instance of - * this type either contains a non-null reference, or contains nothing (in which case we say that - * the reference is "absent"); it is never said to "contain {@code null}". - * - *

A non-null {@code Optional} reference can be used as a replacement for a nullable {@code T} - * reference. It allows you to represent "a {@code T} that must be present" and a "a {@code T} that - * might be absent" as two distinct types in your program, which can aid clarity. - * - * @param the type of instance that can be contained. {@code Optional} is naturally covariant on - * this type, so it is safe to cast an {@code Optional} to {@code Optional} for any - * supertype {@code S} of {@code T}. - */ -public abstract class Optional { - - Optional() {} - - /** Returns an {@code Optional} instance with no contained reference. */ - public static Optional absent() { - return Absent.withType(); - } - - /** Returns an {@code Optional} instance containing the given non-null reference. */ - public static Optional of(T reference) { - return new Present(checkNotNull(reference)); - } - - /** - * If {@code nullableReference} is non-null, returns an {@code Optional} instance containing that - * reference; otherwise returns {@link Optional#absent}. - */ - public static Optional fromNullable(@Nullable T nullableReference) { - return (nullableReference == null) ? Optional.absent() : new Present(nullableReference); - } - - /** Returns {@code true} if this holder contains a (non-null) instance. */ - public abstract boolean isPresent(); - - /** - * Returns the contained instance, which must be present. If the instance might be absent, use - * {@link #or(Object)} or {@link #orNull} instead. - * - * @throws IllegalStateException if the instance is absent ({@link #isPresent} returns {@code - * false}) - */ - public abstract T get(); - - /** Returns the contained instance if it is present; {@code defaultValue} otherwise. */ - public abstract T or(T defaultValue); - - /** Returns this {@code Optional} if it has a value present; {@code secondChoice} otherwise. */ - public abstract Optional or(Optional secondChoice); - - /** Returns the contained instance if it is present; {@code null} otherwise. */ - @Nullable - public abstract T orNull(); - - /** - * If the instance is present, it is transformed with the given {@link Function}; otherwise, - * {@link Optional#absent} is returned. - * - *

Comparison to {@code java.util.Optional}: this method is similar to Java 8's {@code - * Optional.map}, except when {@code function} returns {@code null}. In this case this method - * throws an exception, whereas the Java 8 method returns {@code Optional.absent()}. - * - * @param function The function to transform the optional - * @param The parameter type - * @return The transformed optional - * @throws NullPointerException if the function returns {@code null} - * @since 12.0 - */ - public abstract Optional transform(Function function); - - /** - * Returns {@code true} if {@code object} is an {@code Optional} instance, and either the - * contained references are {@linkplain Object#equals equal} to each other or both are absent. - * Note that {@code Optional} instances of differing parameterized types can be equal. - */ - @Override - public abstract boolean equals(Object object); - - /** Returns a hash code for this instance. */ - @Override - public abstract int hashCode(); - - /** - * Returns a string representation for this instance. The form of this string representation is - * unspecified. - */ - @Override - public abstract String toString(); -} diff --git a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Preconditions.java b/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Preconditions.java deleted file mode 100644 index a40b38c7..00000000 --- a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Preconditions.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2013 The Guava Authors - * Modifications copyright (C) 2017 Uber Technologies, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.uber.rib.core; - -import androidx.annotation.Nullable; - -/** - * Static convenience methods that help a method or constructor check whether it was invoked - * correctly (whether its preconditions have been met). These methods generally accept a - * {@code boolean} expression which is expected to be {@code true} (or in the case of {@code - * checkNotNull}, an object reference which is expected to be non-null). When {@code false} (or - * {@code null}) is passed instead, the {@code Preconditions} method throws an unchecked exception, - * which helps the calling method communicate to its caller that that caller has made - * a mistake. - */ -final class Preconditions { - - private Preconditions() {} - - /** - * Ensures the truth of an expression involving one or more parameters to the calling method. - * - * @param expression a boolean expression - * @throws IllegalArgumentException if {@code expression} is false - */ - public static void checkArgument(boolean expression) { - if (!expression) { - throw new IllegalArgumentException(); - } - } - - /** - * Ensures that an object reference passed as a parameter to the calling method is not null. - * - * @param reference an object reference - * @return the non-null reference that was validated - * @throws NullPointerException if {@code reference} is null - */ - public static T checkNotNull(@Nullable T reference) { - if (reference == null) { - throw new NullPointerException(); - } - return reference; - } -} diff --git a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Present.java b/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Present.java deleted file mode 100644 index f8c7fe07..00000000 --- a/android/libraries/rib-uava/src/main/java/com/uber/rib/core/Present.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2013 The Guava Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.uber.rib.core; - -import java.util.function.Function; - -import static com.uber.rib.core.Preconditions.checkNotNull; - -/** Implementation of an {@link Optional} containing a reference. */ -final class Present extends Optional { - - private final T reference; - - Present(T reference) { - this.reference = reference; - } - - @Override - public boolean isPresent() { - return true; - } - - @Override - public T get() { - return reference; - } - - @Override - public T or(T defaultValue) { - checkNotNull(defaultValue); - return reference; - } - - @Override - public Optional or(Optional secondChoice) { - checkNotNull(secondChoice); - return this; - } - - @Override - public T orNull() { - return reference; - } - - @Override - public Optional transform(Function function) { - return new Present(checkNotNull(function.apply(reference))); - } - - @Override - public boolean equals(Object object) { - if (object instanceof Present) { - Present other = (Present) object; - return reference.equals(other.reference); - } - return false; - } - - @Override - public int hashCode() { - return 0x598df91c + reference.hashCode(); - } - - @Override - public String toString() { - return "Optional.of(" + reference + ")"; - } -} diff --git a/android/libraries/rib-workflow-test-utils/build.gradle b/android/libraries/rib-workflow-test-utils/build.gradle index 8fdc5cfa..fbb7108f 100644 --- a/android/libraries/rib-workflow-test-utils/build.gradle +++ b/android/libraries/rib-workflow-test-utils/build.gradle @@ -45,9 +45,9 @@ android { } dependencies { - compileOnly deps.androidx.annotations + implementation deps.androidx.annotations api project(":libraries:rib-workflow") - api project(":libraries:rib-uava") + api deps.external.guavaAndroid api deps.external.rxjava2 implementation deps.test.assertj } diff --git a/android/libraries/rib-workflow-test-utils/src/main/java/com/uber/rib/workflow/core/StepTester.java b/android/libraries/rib-workflow-test-utils/src/main/java/com/uber/rib/workflow/core/StepTester.java index 3f84415f..1618a3e6 100644 --- a/android/libraries/rib-workflow-test-utils/src/main/java/com/uber/rib/workflow/core/StepTester.java +++ b/android/libraries/rib-workflow-test-utils/src/main/java/com/uber/rib/workflow/core/StepTester.java @@ -18,7 +18,7 @@ package com.uber.rib.workflow.core; import androidx.annotation.Nullable; -import com.uber.rib.core.Optional; +import com.google.common.base.Optional; import io.reactivex.Observable; import io.reactivex.observers.TestObserver; diff --git a/android/libraries/rib-workflow/build.gradle b/android/libraries/rib-workflow/build.gradle index 654ee2d1..68571783 100644 --- a/android/libraries/rib-workflow/build.gradle +++ b/android/libraries/rib-workflow/build.gradle @@ -40,8 +40,8 @@ android { dependencies { implementation deps.androidx.annotations implementation deps.external.rxandroid2 + api deps.external.guavaAndroid api deps.external.rxjava2 - api project(':libraries:rib-uava') api project(":libraries:rib-android") testImplementation deps.test.junit testImplementation deps.test.assertj diff --git a/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Step.java b/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Step.java index 2362f75f..5c152175 100644 --- a/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Step.java +++ b/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Step.java @@ -16,7 +16,7 @@ package com.uber.rib.workflow.core; -import com.uber.rib.core.Optional; +import com.google.common.base.Optional; import com.uber.rib.core.lifecycle.InteractorEvent; import io.reactivex.Observable; diff --git a/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Workflow.java b/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Workflow.java index 64e19a90..635d407f 100644 --- a/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Workflow.java +++ b/android/libraries/rib-workflow/src/main/java/com/uber/rib/workflow/core/Workflow.java @@ -16,7 +16,7 @@ package com.uber.rib.workflow.core; -import com.uber.rib.core.Optional; +import com.google.common.base.Optional; import io.reactivex.Single; diff --git a/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/StepTest.java b/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/StepTest.java index 29736956..78a4b515 100644 --- a/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/StepTest.java +++ b/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/StepTest.java @@ -18,7 +18,7 @@ package com.uber.rib.workflow.core; import androidx.annotation.NonNull; -import com.uber.rib.core.Optional; +import com.google.common.base.Optional; import com.uber.rib.core.lifecycle.InteractorEvent; import org.junit.Before; diff --git a/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/WorkflowTest.java b/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/WorkflowTest.java index 3075c48e..20495c96 100644 --- a/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/WorkflowTest.java +++ b/android/libraries/rib-workflow/src/test/java/com/uber/rib/workflow/core/WorkflowTest.java @@ -18,7 +18,7 @@ package com.uber.rib.workflow.core; import androidx.annotation.NonNull; -import com.uber.rib.core.Optional; +import com.google.common.base.Optional; import com.uber.rib.core.lifecycle.InteractorEvent; import org.junit.After; diff --git a/android/settings.gradle b/android/settings.gradle index 31c1a1ab..2cbddd7c 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -7,7 +7,6 @@ include ':libraries:rib-compiler-test' include ':libraries:rib-debug-utils' include ':libraries:rib-screen-stack-base' include ':libraries:rib-router-navigator' -include ':libraries:rib-uava' include ':libraries:rib-workflow' include ':libraries:rib-workflow-test-utils' include ':tooling:rib-intellij-plugin' diff --git a/android/tooling/autodispose-error-prone-checker/build.gradle b/android/tooling/autodispose-error-prone-checker/build.gradle index bb5a06b9..de477453 100644 --- a/android/tooling/autodispose-error-prone-checker/build.gradle +++ b/android/tooling/autodispose-error-prone-checker/build.gradle @@ -42,12 +42,15 @@ dependencies { compile deps.uber.autodispose compile project(':libraries:rib-base') errorprone deps.build.errorProne + errorprone deps.build.guavaJre errorproneJavac deps.build.errorProneJavac annotationProcessor deps.apt.autoService compileOnly deps.apt.autoService compileOnly "com.google.code.findbugs:jsr305:3.0.2" + testCompile deps.androidx.annotations + testCompile deps.build.guavaJre testCompile deps.test.junit testCompile(deps.build.errorProneTestHelpers) { exclude group: "junit", module: "junit" diff --git a/android/tooling/rib-intellij-plugin/build.gradle b/android/tooling/rib-intellij-plugin/build.gradle index 4efc1230..5575ba15 100644 --- a/android/tooling/rib-intellij-plugin/build.gradle +++ b/android/tooling/rib-intellij-plugin/build.gradle @@ -17,7 +17,7 @@ repositories { dependencies { compile deps.apt.androidApi compile deps.build.commonsLang - compile deps.build.guava + compile deps.external.guavaAndroid compile deps.androidx.annotations testCompile(project(":libraries:rib-base")) { diff --git a/android/tutorials/tutorial1/build.gradle b/android/tutorials/tutorial1/build.gradle index f69465fd..ac71f8e9 100644 --- a/android/tutorials/tutorial1/build.gradle +++ b/android/tutorials/tutorial1/build.gradle @@ -62,5 +62,6 @@ dependencies { errorproneJavac deps.build.errorProneJavac errorprone deps.build.nullAway errorprone deps.build.errorProne + errorprone deps.build.guavaJre } diff --git a/android/tutorials/tutorial2/build.gradle b/android/tutorials/tutorial2/build.gradle index 65979c8a..e1a85ff6 100644 --- a/android/tutorials/tutorial2/build.gradle +++ b/android/tutorials/tutorial2/build.gradle @@ -66,6 +66,7 @@ dependencies { errorproneJavac deps.build.errorProneJavac errorprone deps.build.nullAway errorprone deps.build.errorProne + errorprone deps.build.guavaJre } tasks.withType(JavaCompile) { diff --git a/android/tutorials/tutorial3-completed/build.gradle b/android/tutorials/tutorial3-completed/build.gradle index a8daed4e..d922e2e1 100644 --- a/android/tutorials/tutorial3-completed/build.gradle +++ b/android/tutorials/tutorial3-completed/build.gradle @@ -53,7 +53,6 @@ dependencies { implementation deps.androidx.appcompat implementation deps.external.dagger implementation deps.external.rxbinding - implementation deps.build.guava implementation deps.androidx.percent compileOnly deps.apt.javax testImplementation project(":libraries:rib-test-utils") diff --git a/android/tutorials/tutorial3/build.gradle b/android/tutorials/tutorial3/build.gradle index 02731ae8..d156d12e 100644 --- a/android/tutorials/tutorial3/build.gradle +++ b/android/tutorials/tutorial3/build.gradle @@ -54,7 +54,7 @@ dependencies { implementation deps.external.dagger implementation deps.external.rxbinding implementation deps.androidx.percent - implementation deps.build.guava + implementation deps.external.guavaAndroid compileOnly deps.apt.javax testImplementation project(":libraries:rib-test-utils") } diff --git a/android/tutorials/tutorial4/build.gradle b/android/tutorials/tutorial4/build.gradle index 238c746d..a4185569 100644 --- a/android/tutorials/tutorial4/build.gradle +++ b/android/tutorials/tutorial4/build.gradle @@ -53,12 +53,13 @@ dependencies { annotationProcessor project(":libraries:rib-compiler-test") implementation project(":libraries:rib-android") implementation project(":libraries:rib-workflow") + implementation deps.androidx.annotations implementation deps.androidx.appcompat implementation deps.external.dagger implementation deps.external.rxbinding implementation deps.uber.rave implementation deps.androidx.percent - implementation deps.build.guava + implementation deps.external.guavaAndroid compileOnly deps.apt.javax compileOnly deps.apt.autoValueAnnotations testImplementation project(":libraries:rib-test-utils") diff --git a/android/tutorials/tutorial4/src/main/java/com/uber/rib/RootActivity.java b/android/tutorials/tutorial4/src/main/java/com/uber/rib/RootActivity.java index eb9695c9..90517375 100644 --- a/android/tutorials/tutorial4/src/main/java/com/uber/rib/RootActivity.java +++ b/android/tutorials/tutorial4/src/main/java/com/uber/rib/RootActivity.java @@ -24,7 +24,7 @@ import android.view.ViewGroup; import com.uber.autodispose.AutoDispose; import com.uber.rave.Rave; import com.uber.rave.RaveException; -import com.uber.rib.core.Optional; +import com.google.common.base.Optional; import com.uber.rib.core.RibActivity; import com.uber.rib.core.ViewRouter; import com.uber.rib.root.RootBuilder; @@ -34,7 +34,7 @@ import com.uber.rib.root.RootWorkflow; import com.uber.rib.root.RootWorkflowModel; import com.uber.rib.root.WorkflowFactory; -import javax.annotation.Nullable; +import androidx.annotation.Nullable; import io.reactivex.functions.Consumer; diff --git a/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/RootRouter.java b/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/RootRouter.java index ecbcfdd5..f33523de 100644 --- a/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/RootRouter.java +++ b/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/RootRouter.java @@ -19,7 +19,7 @@ package com.uber.rib.root; import androidx.annotation.Nullable; import com.jakewharton.rxrelay2.BehaviorRelay; -import com.uber.rib.core.Optional; +import com.google.common.base.Optional; import com.uber.rib.core.ViewRouter; import com.uber.rib.root.logged_in.LoggedInActionableItem; import com.uber.rib.root.logged_in.LoggedInBuilder; diff --git a/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/WorkflowFactory.java b/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/WorkflowFactory.java index 93be3159..a16924e6 100644 --- a/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/WorkflowFactory.java +++ b/android/tutorials/tutorial4/src/main/java/com/uber/rib/root/WorkflowFactory.java @@ -2,7 +2,7 @@ package com.uber.rib.root; import android.content.Intent; -import javax.annotation.Nullable; +import androidx.annotation.Nullable; public class WorkflowFactory { @Nullable