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

Updated Kotlin to 1.9.23 #195

Merged
merged 4 commits into from
Apr 4, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### Pending changes

([#195](https://github.com/badoo/MVICore/pull/195)):
Updated Kotlin to 1.9.23

([#193](https://github.com/badoo/MVICore/pull/193)):
Updated Kotlin to 1.8.10

Expand Down
4 changes: 2 additions & 2 deletions binder/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Comment on lines +10 to +11
Copy link
Collaborator Author

@LachlanMcKee LachlanMcKee Apr 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgraded to ensure that MVICore works with apps that are still using Java 11
The update to 17 has not been released as yet so this is not a breaking change.

}

tasks.withType<Test> {
Expand Down
15 changes: 14 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
Expand All @@ -8,7 +11,7 @@ buildscript {
dependencies {
classpath(libs.plugin.android)
classpath(libs.plugin.kotlin)
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${libs.versions.kotlinVersion.get()}")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${libs.versions.dokka.get()}")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down Expand Up @@ -52,3 +55,13 @@ dependencyAnalysis {
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}

subprojects {
afterEvaluate {
tasks.withType(KotlinJvmCompile::class.java).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
}
}
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[versions]
kotlinVersion = "1.8.10"
kotlinVersion = "1.9.23"
detekt = "1.22.0"
dependencyAnalysis = "1.19.0"
dokka = "1.9.20" # Dokka versions no longer match Kotlin 1:1

# Android
androidLifecycleVersion = "2.6.1"
Expand Down
4 changes: 2 additions & 2 deletions mvicore-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
4 changes: 2 additions & 2 deletions mvicore-debugdrawer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
4 changes: 2 additions & 2 deletions mvicore-demo/mvicore-demo-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.reactivex.ObservableSource
import io.reactivex.Observer
import io.reactivex.subjects.PublishSubject

abstract class ObservableSourceActivity<T> : DebugActivity(), ObservableSource<T> {
abstract class ObservableSourceActivity<T : Any> : DebugActivity(), ObservableSource<T> {

private val source = PublishSubject.create<T>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package com.badoo.mvicoredemo.ui.main.event

sealed class UiEvent {
data class ButtonClicked(val idx: Int) : UiEvent()
object PlusClicked : UiEvent()
object ImageClicked : UiEvent()
data object PlusClicked : UiEvent()
data object ImageClicked : UiEvent()
}
4 changes: 2 additions & 2 deletions mvicore-demo/mvicore-demo-catapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
4 changes: 2 additions & 2 deletions mvicore-demo/mvicore-demo-feature1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Feature1 : ReducerFeature<Wish, State, Nothing>(
)

sealed class Wish {
object IncreaseCounter : Wish()
data object IncreaseCounter : Wish()
data class SetActiveButton(val idx: Int) : Wish()
}

Expand Down
4 changes: 2 additions & 2 deletions mvicore-demo/mvicore-demo-feature2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class Feature2(
) : Parcelable

sealed class Wish {
object LoadNewImage : Wish()
data object LoadNewImage : Wish()
}

sealed class Effect {
object StartedLoading : Effect()
data object StartedLoading : Effect()
data class LoadedImage(val url: String) : Effect()
data class ErrorLoading(val throwable: Throwable) : Effect()
}
Expand Down
4 changes: 2 additions & 2 deletions mvicore-diff/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<Test> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ sealed class SealedModel {
val nullable: Boolean? = null
): SealedModel()

object Nothing: SealedModel() {
data object Nothing: SealedModel() {
override val list: List<String> = emptyList()
}
}

sealed class Nested {
sealed class SubNested : Nested() {
data class Value(val list: List<String>) : SubNested()
object Nothing : SubNested()
data object Nothing : SubNested()
}
object Something: Nested()
data object Something: Nested()
}
4 changes: 2 additions & 2 deletions mvicore-plugin/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

base.archivesBaseName = "mvicore-plugin-common"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ sealed class Event(val type: String) {
val name: String
) : Event("connect")

object Ping: Event("ping")
data object Ping: Event("ping")
}
4 changes: 2 additions & 2 deletions mvicore-plugin/idea/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

group = "com.github.badoo.mvicore"
Expand Down
4 changes: 2 additions & 2 deletions mvicore-plugin/middleware/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

base.archivesBaseName = "mvicore-plugin-middleware"
Expand Down
4 changes: 2 additions & 2 deletions mvicore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<Test> {
Expand Down
2 changes: 1 addition & 1 deletion mvicore/src/main/java/com/badoo/mvicore/extension/Rx.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.reactivex.Observer
import io.reactivex.Scheduler
import io.reactivex.functions.Consumer

fun <T> Observer<T>.asConsumer() = Consumer<T> { onNext(it) }
fun <T : Any> Observer<T>.asConsumer() = Consumer<T> { onNext(it) }

internal fun <T> Observable<T>.subscribeOnNullable(scheduler: Scheduler?): Observable<T> =
if (scheduler != null) subscribeOn(scheduler) else this
38 changes: 19 additions & 19 deletions mvicore/src/test/java/com/badoo/mvicore/TestHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,36 @@ class TestHelper {
}

sealed class TestWish {
object Unfulfillable : TestWish()
object MaybeFulfillable : TestWish()
object FulfillableInstantly1 : TestWish()
object FulfillableInstantly2 : TestWish()
data object Unfulfillable : TestWish()
data object MaybeFulfillable : TestWish()
data object FulfillableInstantly1 : TestWish()
data object FulfillableInstantly2 : TestWish()
data class FulfillableAsync(val delayMs: Long) : TestWish()
object TranslatesTo3Effects : TestWish()
object LoopbackWishInitial : TestWish()
object LoopbackWish1 : TestWish()
object LoopbackWish2 : TestWish()
object LoopbackWish3 : TestWish()
data object TranslatesTo3Effects : TestWish()
data object LoopbackWishInitial : TestWish()
data object LoopbackWish1 : TestWish()
data object LoopbackWish2 : TestWish()
data object LoopbackWish3 : TestWish()
data class IncreasCounterBy(val value: Int) : TestWish()
}

sealed class TestEffect {
object StartedAsync : TestEffect()
data object StartedAsync : TestEffect()
data class InstantEffect(val amount: Int) : TestEffect()
data class FinishedAsync(val amount: Int) : TestEffect()
data class ConditionalThingHappened(val multiplier: Int) : TestEffect()
object MultipleEffect1 : TestEffect()
object MultipleEffect2 : TestEffect()
object MultipleEffect3 : TestEffect()
object LoopbackEffectInitial : TestEffect()
object LoopbackEffect1 : TestEffect()
object LoopbackEffect2 : TestEffect()
object LoopbackEffect3 : TestEffect()
data object MultipleEffect1 : TestEffect()
data object MultipleEffect2 : TestEffect()
data object MultipleEffect3 : TestEffect()
data object LoopbackEffectInitial : TestEffect()
data object LoopbackEffect1 : TestEffect()
data object LoopbackEffect2 : TestEffect()
data object LoopbackEffect3 : TestEffect()
}

sealed class TestNews {
object ConditionalThingHappened : TestNews()
object Loopback : TestNews()
data object ConditionalThingHappened : TestNews()
data object Loopback : TestNews()
}

class TestActor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import org.mockito.kotlin.verify
class BootstrapperTest {

private sealed class Action {
object Action1 : Action()
object Action2 : Action()
object Action3 : Action()
data object Action1 : Action()
data object Action2 : Action()
data object Action3 : Action()
}

private lateinit var feature: Feature<Any, Any, Any>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ private class PostProcessorTestFeature(featureScheduler: FeatureScheduler?) :
) {

sealed class Wish {
object InitialTrigger : Wish()
object PostProcessorTrigger : Wish()
data object InitialTrigger : Wish()
data object PostProcessorTrigger : Wish()
}

sealed class Effect {
object TriggerEffect : Effect()
object PostProcessorEffect : Effect()
data object TriggerEffect : Effect()
data object PostProcessorEffect : Effect()
}

object State

sealed class News {
object TriggerNews : News()
object PostProcessorNews : News()
data object TriggerNews : News()
data object PostProcessorNews : News()
}

class ActorImpl : Actor<State, Wish, Effect> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class TrampolineFeatureSchedulerTest {
featureScheduler = featureScheduler
) {
sealed class Wish {
object Trigger : Wish()
data object Trigger : Wish()
}

sealed class Effect {
object Mutate : Effect()
data object Mutate : Effect()
}

data class State(val mutated: Boolean = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ import org.mockito.kotlin.whenever


sealed class TestWish {
object Wish1 : TestWish()
object Wish2 : TestWish()
object Wish3 : TestWish()
data object Wish1 : TestWish()
data object Wish2 : TestWish()
data object Wish3 : TestWish()
}

sealed class TestNews {
object News1 : TestNews()
object News2 : TestNews()
object News3 : TestNews()
data object News1 : TestNews()
data object News2 : TestNews()
data object News3 : TestNews()
}

class Parameter(val middlewareConfiguration: MiddlewareConfiguration?) {
Expand Down
Loading