Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def kotlinVersion = '1.9.21'
def versions = [
dagger : '2.45',
kotlin : kotlinVersion,
mviCore : '1.4.0',
mviCore : '2.0.0',
robolectric : '4.13',
composeBom : '2023.10.01',
composeCompiler : '1.5.7',
Expand All @@ -37,7 +37,7 @@ def versions = [
androidxSavedStateVersion : '1.2.0', // https://developer.android.com/jetpack/androidx/releases/savedstate
androidxTestVersion : '1.5.0', // https://developer.android.com/jetpack/androidx/releases/test
androidxTestUiAutoVersion : '2.2.0',
retrofitVersion : '2.9.0',
retrofitVersion : '2.11.0',
okhttp : '3.14.7',
leakCanary : '2.9.1',
jacoco : '0.8.8',
Expand All @@ -52,7 +52,7 @@ def apt = [
javaxInject : "javax.inject:javax.inject:1",
]

def agp = 'com.android.tools.build:gradle:8.2.2'
def agp = 'com.android.tools.build:gradle:8.9.1'

def build = [
compileSdk : 34,
Expand Down Expand Up @@ -114,9 +114,9 @@ def external = [
mviCoreAndroid : "com.github.badoo.mvicore:mvicore-android:${versions.mviCore}",
mviCoreBinder : "com.github.badoo.mvicore:binder:${versions.mviCore}",
mviCoreDiff : "com.github.badoo.mvicore:mvicore-diff:${versions.mviCore}",
rxjava2 : "io.reactivex.rxjava2:rxjava:2.2.18",
rxrelay2 : "com.jakewharton.rxrelay2:rxrelay:2.1.0",
rxandroid2 : "io.reactivex.rxjava2:rxandroid:2.1.1",
rxjava3 : "io.reactivex.rxjava3:rxjava:3.1.10",
rxrelay3 : "com.jakewharton.rxrelay3:rxrelay:3.0.1",
rxandroid3 : "io.reactivex.rxjava3:rxandroid:3.0.2",
roboelectricBase : "org.robolectric:robolectric:${versions.robolectric}",
coil : "io.coil-kt:coil:${versions.coil}",
leakCanary : "com.squareup.leakcanary:leakcanary-android:${versions.leakCanary}",
Expand All @@ -125,7 +125,7 @@ def external = [

def retrofit = [
retrofit : "com.squareup.retrofit2:retrofit:${versions.retrofitVersion}",
rxjavaAdapter : "com.squareup.retrofit2:adapter-rxjava2:${versions.retrofitVersion}",
rxjavaAdapter : "com.squareup.retrofit2:adapter-rxjava3:${versions.retrofitVersion}",
moshiConverter : "com.squareup.retrofit2:converter-moshi:${versions.retrofitVersion}",
okhttp : "com.squareup.okhttp3:okhttp:${versions.okhttp}",
okhttpLoggingInterceptor: "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}",
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Jun 14 23:02:25 BST 2020
#Wed Apr 02 17:45:41 BST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import java.util.concurrent.TimeoutException
private const val DEFAULT_CONDITION_TIMEOUT_MILLISECONDS = 15000L
private const val DEFAULT_CHECK_CONDITION_FREQUENCY_MILLIS = 10L

fun waitFor(timeoutMillis: Long = DEFAULT_CONDITION_TIMEOUT_MILLISECONDS, condition: () -> Boolean) {
fun waitFor(
timeoutMillis: Long = DEFAULT_CONDITION_TIMEOUT_MILLISECONDS,
condition: () -> Boolean
) {
val start = System.currentTimeMillis()
while (!condition()) {
if (System.currentTimeMillis() > start + timeoutMillis) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class SampleViewImpl(

val lifecycle: Lifecycle = context.lifecycle

override val androidView: ViewGroup
override val androidView: ViewGroup = FrameLayout(context.parent.context)

init {
androidView = FrameLayout(context.parent.context)
val child = TextView(context.parent.context)
child.id = viewId
child.text = TextView::class.qualifiedName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>

Expand Down
3 changes: 0 additions & 3 deletions libraries/rib-base-test-rx2/gradle.properties

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
configureAndroidLibrary(project)

android {
namespace 'com.badoo.ribs.test.rx2'
namespace 'com.badoo.ribs.test.rx3'

defaultConfig {
versionCode 1
Expand All @@ -19,10 +19,10 @@ android {
dependencies {
compileOnly project(':libraries:rib-base')
compileOnly project(':libraries:rib-base-test')
compileOnly project(':libraries:rib-rx2')
api deps.external.rxjava2
api deps.external.rxrelay2
compileOnly project(':libraries:rib-rx3')

api deps.external.rxjava3
api deps.external.rxrelay3

implementation deps.test.mockitoKotlin
}
Expand Down
3 changes: 3 additions & 0 deletions libraries/rib-base-test-rx3/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=RIBs (Base Test Rx3 helpers)
POM_ARTIFACT_ID=rib-base-test-rx3
POM_PACKAGING=android
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package com.badoo.common.ribs.rx2
package com.badoo.common.ribs.rx3

import android.view.ViewGroup
import com.badoo.ribs.clienthelper.interactor.Interactor
import com.badoo.ribs.core.Rib
import com.badoo.ribs.core.view.RibView
import com.badoo.ribs.rx2.clienthelper.connector.Connectable
import com.badoo.ribs.rx3.clienthelper.connector.Connectable
import com.badoo.ribs.test.InteractorTestHelper
import com.jakewharton.rxrelay2.PublishRelay
import com.jakewharton.rxrelay2.Relay
import io.reactivex.ObservableSource
import io.reactivex.Observer
import com.jakewharton.rxrelay3.PublishRelay
import com.jakewharton.rxrelay3.Relay
import io.reactivex.rxjava3.core.ObservableSource
import io.reactivex.rxjava3.core.Observer
import org.mockito.kotlin.any
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever

@Deprecated("Use RibInteractorTestHelper")
inline fun <reified View, ViewEvent> createInteractorTestHelper(
inline fun <reified View, ViewEvent : Any> createInteractorTestHelper(
interactor: Interactor<*, View>,
viewEventRelay: Relay<ViewEvent>
): InteractorTestHelper<View> where View : RibView, View : ObservableSource<ViewEvent> {
val view: View = viewEventRelay.subscribedView()
return InteractorTestHelper(interactor, { view })
return InteractorTestHelper(interactor) { view }
}

@Deprecated("Use RibInteractorTestHelper")
Expand All @@ -36,7 +36,7 @@ inline fun <reified R, reified Input, reified Output> Interactor<R, *>.mockIO(
}

@Deprecated("Use RibInteractorTestHelper")
inline fun <reified RView, ViewEvent> Relay<ViewEvent>.subscribedView(): RView where RView : RibView, RView : ObservableSource<ViewEvent> =
inline fun <reified RView, ViewEvent : Any> Relay<ViewEvent>.subscribedView(): RView where RView : RibView, RView : ObservableSource<ViewEvent> =
mock<RView>().apply {
whenever(this.androidView).thenReturn(mock<ViewGroup>())
whenever(this.subscribe(any())).thenAnswer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.badoo.ribs.test.rx2.view
package com.badoo.ribs.test.rx3.view

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.ViewGroup
import com.badoo.ribs.core.view.AndroidRibView
import com.badoo.ribs.test.assertEquals
import com.jakewharton.rxrelay2.PublishRelay
import com.jakewharton.rxrelay2.Relay
import io.reactivex.ObservableSource
import io.reactivex.functions.Consumer
import com.jakewharton.rxrelay3.PublishRelay
import com.jakewharton.rxrelay3.Relay
import io.reactivex.rxjava3.core.ObservableSource
import io.reactivex.rxjava3.functions.Consumer
import org.mockito.Mockito.mock

/* Sync with other versions. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class InteractorTestHelper<View : RibView>(
when (state) {
Lifecycle.State.DESTROYED,
Lifecycle.State.INITIALIZED -> throw IllegalArgumentException("Unsupported state: $state")

Lifecycle.State.CREATED -> toAttachViewState(block)
Lifecycle.State.STARTED -> toStartState(block)
Lifecycle.State.RESUMED -> toResumeState(block)
Expand Down
6 changes: 3 additions & 3 deletions libraries/rib-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
testImplementation deps.external.mviCore
testImplementation deps.external.mviCoreAndroid
testImplementation deps.external.mviCoreBinder
testImplementation deps.external.rxrelay2
testImplementation deps.external.rxrelay3

junitTestImplementation(project)
testImplementation deps.android.annotations
Expand All @@ -28,14 +28,14 @@ dependencies {
testImplementation deps.test.mockitoKotlin
testImplementation project(":libraries:rib-base-test")

androidTestImplementation deps.external.rxjava2
androidTestImplementation deps.external.rxjava3
junitAndroidTestImplementation(project)
androidTestImplementation deps.test.assertj
androidTestImplementation deps.androidTest.espresso
androidTestImplementation deps.androidTest.espressoIntents
androidTestImplementation deps.androidTest.runner
androidTestImplementation deps.androidTest.rules
androidTestImplementation project(":libraries:rib-rx2")
androidTestImplementation project(':libraries:rib-rx3')
androidTestImplementation project(":libraries:rib-base-test")
androidTestImplementation project(':libraries:rib-base-test-activity')
}
Expand Down
7 changes: 4 additions & 3 deletions libraries/rib-base/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat">
android:allowBackup="true"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat">

<activity android:name="com.badoo.ribs.test.util.TestActivity" />
<activity android:name="com.badoo.ribs.test.util.OtherActivity" />
Expand Down
Loading
Loading