Skip to content

Commit

Permalink
Update Kotlin, Compose, and Zipline (#1752)
Browse files Browse the repository at this point in the history
* Update Kotlin, Compose, and Zipline

* Track a zipline API change

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jesse Wilson <[email protected]>
  • Loading branch information
renovate[bot] and squarejesse authored Jan 18, 2024
1 parent 77b5f68 commit 603b846
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
kotlin = "1.9.21"
kotlin = "1.9.22"
kotlinx-coroutines = "1.7.3"
kotlinx-serialization = "1.6.2"
androidx-activity = "1.8.2"
androidx-compose-ui = "1.5.4"
jbCompose = "1.5.11"
lint = "31.2.1"
zipline = "1.7.0"
zipline = "1.8.0"
coil = "3.0.0-alpha02"
okio = "3.7.0"
ktor = "2.3.7"
Expand Down Expand Up @@ -38,7 +38,7 @@ buildConfigPlugin = "com.github.gmazzo:gradle-buildconfig-plugin:3.1.0"
androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx.activity" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx.activity" }
androidx-appCompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" }
androidx-compose-compiler = "androidx.compose.compiler:compiler:1.5.7"
androidx-compose-compiler = "androidx.compose.compiler:compiler:1.5.8"
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidx-compose-ui" }
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidx-compose-ui" }
androidx-core = { module = "androidx.core:core-ktx", version = "1.12.0" }
Expand All @@ -50,7 +50,7 @@ androidx-test-uiautomator = "androidx.test.uiautomator:uiautomator:2.2.0"

google-material = { module = "com.google.android.material:material", version = "1.11.0" }

jetbrains-compose-compiler = "org.jetbrains.compose.compiler:compiler:1.5.4"
jetbrains-compose-compiler = "org.jetbrains.compose.compiler:compiler:1.5.7.1"
jetbrains-compose-gradlePlugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "jbCompose" }
jetbrains-compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "jbCompose" }
jetbrains-compose-material = { module = "org.jetbrains.compose.material:material", version.ref = "jbCompose" }
Expand Down Expand Up @@ -83,6 +83,6 @@ ktor-engine-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "kto
turbine = "app.cash.turbine:turbine:1.0.0"
ktlint = "com.pinterest.ktlint:ktlint-cli:1.1.1"
googleJavaFormat = "com.google.googlejavaformat:google-java-format:1.19.2"
poko-gradlePlugin = "dev.drewhamilton.poko:poko-gradle-plugin:0.15.1"
poko-gradlePlugin = "dev.drewhamilton.poko:poko-gradle-plugin:0.15.2"

lint-core = { module = "com.android.tools.lint:lint", version.ref = "lint" }
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ package app.cash.redwood.treehouse

import app.cash.zipline.EventListener as ZiplineEventListener
import app.cash.zipline.Zipline
import app.cash.zipline.loader.DefaultFreshnessCheckerNotFresh
import app.cash.zipline.loader.FreshnessChecker
import app.cash.zipline.loader.LoadResult
import app.cash.zipline.loader.ManifestVerifier
import app.cash.zipline.loader.ZiplineCache
Expand Down Expand Up @@ -159,6 +161,7 @@ public class TreehouseApp<A : AppService> private constructor(
applicationName = spec.name,
manifestUrlFlow = spec.manifestUrl,
serializersModule = spec.serializersModule,
freshnessChecker = spec.freshnessChecker,
) { zipline ->
spec.bindServices(zipline)
}
Expand Down Expand Up @@ -239,6 +242,9 @@ public class TreehouseApp<A : AppService> private constructor(
public open val serializersModule: SerializersModule
get() = EmptySerializersModule()

public open val freshnessChecker: FreshnessChecker
get() = DefaultFreshnessCheckerNotFresh

/**
* Returns true to only load code from the network. Otherwise, this will recover from
* unreachable network code by loading code from the cache or the embedded file system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ package com.example.redwood.emojisearch.launcher

import app.cash.redwood.treehouse.TreehouseApp
import app.cash.zipline.Zipline
import app.cash.zipline.ZiplineManifest
import app.cash.zipline.loader.FreshnessChecker
import com.example.redwood.emojisearch.treehouse.EmojiSearchPresenter
import com.example.redwood.emojisearch.treehouse.HostApi
import com.example.redwood.emojisearch.treehouse.emojiSearchSerializersModule
Expand All @@ -29,6 +31,11 @@ class EmojiSearchAppSpec(
override val name = "emoji-search"
override val serializersModule = emojiSearchSerializersModule

override val freshnessChecker: FreshnessChecker
get() = object : FreshnessChecker {
override fun isFresh(manifest: ZiplineManifest, freshAtEpochMs: Long) = true
}

override fun bindServices(zipline: Zipline) {
zipline.bind<HostApi>("HostApi", hostApi)
}
Expand Down

0 comments on commit 603b846

Please sign in to comment.